你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
cuixueying
赞同来自:
/** * 角色创建 */ public function init(interval,type:String,hp:Number,speed:Number,hitRadius:Number,camp:Number,heroType:Number = 0):void { //初始化属性 this.type = type; this.hp = hp; this.speed = speed; this.hitRadius = hitRadius; this.camp = camp; this.heroType = heroType; if(!Role.cacheAs) { Role.cacheAs = true; //缓存飞机飞行动画 Animation.createFrames(["war/hero_fly1.png", "war/hero_fly2.png"], "hero_fly"); //缓存飞机死亡动画 Animation.createFrames(["war/hero_down1.png", "war/hero_down2.png", "war/hero_down3.png", "war/hero_down4.png"], "hero_down"); //缓存敌机1飞行动画 Animation.createFrames(["war/enemy1_fly1.png"], "enemy1_fly"); //缓存飞机1死亡动画 Animation.createFrames(["war/enemy1_down1.png", "war/enemy1_down2.png", "war/enemy1_down3.png", "war/enemy1_down4.png"], "enemy1_down"); //缓存敌机2飞行动画 Animation.createFrames(["war/enemy2_fly1.png"], "enemy2_fly"); //缓存飞机2死亡动画 Animation.createFrames(["war/enemy2_down1.png", "war/enemy2_down2.png", "war/enemy2_down3.png", "war/enemy2_down4.png"], "enemy2_down"); //缓存飞机2击中动画 Animation.createFrames(["war/enemy2_hit.png"], "enemy2_hit"); //缓存敌机3飞行动画 Animation.createFrames(["war/enemy3_fly1.png"], "enemy3_fly"); //缓存飞机3死亡动画 Animation.createFrames(["war/enemy3_down1.png", "war/enemy3_down2.png", "war/enemy3_down3.png", "war/enemy3_down4.png"], "enemy3_down"); //缓存飞机3击中动画 Animation.createFrames(["war/enemy3_hit.png"], "enemy3_hit"); //缓存子弹动画 Animation.createFrames(["war/bullet1.png"], "bullet1_fly"); //缓存强化道具 Animation.createFrames(["war/ufo1.png"], "ufo1_fly"); //缓存医疗包 Animation.createFrames(["war/ufo2.png"], "ufo2_fly"); } if (!body){ //创建动画作为飞机的身体 body = new Animation(); //动画播放时间间隔 body.interval = interval; //将动画加入到容器中 this.addChild(body); //增加动画播放完成监听 body.on("complete", this, this.onPlayComplete); } //播放当前状态的动画 this.playAction("fly"); }
要回复问题请先登录
1 个回复
cuixueying
赞同来自: