最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
flash9太阳地球月亮系统
时间:2022-07-02 17:16:59 编辑:袖梨 来源:一聚教程网
除了背景以外,全部使用as3代码:
var sun:Sprite = new Sprite();
sun.graphics.lineStyle(0,0xFF6600);
sun.graphics.beginFill(0xFF3300);
sun.graphics.drawCircle(0,0,40);
sun.graphics.endFill();
var earth:Sprite = new Sprite();
earth.graphics.lineStyle(0,0x92E9FE);
earth.graphics.beginFill(0x00CCFF);
earth.graphics.drawCircle(0,0,20);
earth.graphics.endFill();
var spot:Shape = new Shape();
spot.graphics.lineStyle(0,0x000000);
spot.graphics.beginFill(0x333333);
spot.graphics.drawCircle(0,0,2);
spot.graphics.endFill();
var moon:Shape = new Shape();
moon.graphics.lineStyle(0,0xFFFFCC);
moon.graphics.beginFill(0xFFFF00);
moon.graphics.drawCircle(0,0,5);
moon.graphics.endFill();
this.addChild(sun);
sun.x = 200;
sun.y = 200;
sun.addChild(spot);
spot.x = 20;
spot.y = 10;
sun.addChild(earth);
earth.x = 120;
earth.y = 0;
earth.addChild(moon);
moon.x = 50;
moon.y = 0;
stage.addEventListener(Event.ENTER_FRAME, orbit);
function orbit(evt:Event):void {
sun.rotation++;
earth.rotation+= 3;
moon.rotation-=5;
}
相关文章
- 炉石传说血DK卡组怎么样 炉石传说血DK卡组推荐介绍 11-05
- 咒术回战幻影夜行官网在哪里 咒术回战幻影夜行官网地址介绍 11-05
- 蚂蚁庄园今天答题答案2024年10月26日 11-05
- 以闪亮之名变装物语甜趣篇怎么玩 11-05
- 闪耀暖暖永夜禁锢怎么玩 11-05
- 闪耀暖暖永夜禁锢怎么玩 闪耀暖暖永夜禁锢活动介绍 11-05