home *** CD-ROM | disk | FTP | other *** search
- package asCode
- {
- import flash.geom.Point;
-
- public class enemyItemClass
- {
- private static var remove:Boolean;
-
- private static var ENEMY_METEOR:int = 1;
-
- private static var ENEMY_BEE:int = 2;
-
- private static var ENEMY_STICK:int = 3;
-
- private var basey:Number;
-
- private var moveRange:Number;
-
- private var cycleNum:Number;
-
- private var enemySubType:int;
-
- private var maxAnimationFrames:int;
-
- private var animationFrame:int;
-
- private var hitTestRadius:int = 30;
-
- private var id:int;
-
- private var enemyType:int;
-
- private var maxSpeed:Number;
-
- private var speed:Number;
-
- private var xVel:Number = 0;
-
- private var yVel:Number = 0;
-
- private var dir:Number = 0;
-
- private var radians:Number = 0;
-
- private var loc:Point;
-
- public function enemyItemClass(param1:Number, param2:Number, param3:Number, param4:Number, param5:int, param6:*, param7:int)
- {
- super();
- loc = new Point(param1,param2);
- basey = param2;
- dir = param3;
- enemyType = param4;
- maxSpeed = param6;
- speed = 0;
- radians = dir / 180 * Math.PI;
- remove = false;
- id = param7;
- animationFrame = 1;
- enemySubType = param5;
- moveRange = 60;
- cycleNum = 0;
- }
-
- public function getAnimationFrame() : int
- {
- return animationFrame;
- }
-
- public function getType() : int
- {
- return enemyType;
- }
-
- public function manageEnemy(param1:Number) : void
- {
- ++animationFrame;
- if(animationFrame > 15)
- {
- animationFrame = 1;
- }
- if(speed < maxSpeed)
- {
- speed += 0.1;
- }
- switch(enemyType)
- {
- case ENEMY_METEOR:
- break;
- case ENEMY_BEE:
- cycleNum += 2;
- loc.y = basey + Math.cos(cycleNum / 180 * Math.PI) * moveRange;
- }
- xVel = Math.cos(radians) * speed;
- yVel = Math.sin(radians) * speed;
- loc.x += xVel;
- loc.y += yVel + param1;
- basey += yVel + param1;
- }
-
- public function getEnemySubType() : int
- {
- return enemySubType;
- }
-
- private function manageBee() : void
- {
- }
-
- private function manageMeteor() : void
- {
- }
-
- public function getHitRadius() : Number
- {
- return hitTestRadius;
- }
-
- public function getDir() : Number
- {
- return dir;
- }
-
- public function getID() : int
- {
- return id;
- }
-
- public function getRemove() : Boolean
- {
- return remove;
- }
-
- public function getDamage() : int
- {
- switch(enemyType)
- {
- case ENEMY_BEE:
- return 30;
- case ENEMY_METEOR:
- return 35;
- case ENEMY_STICK:
- return 20;
- default:
- return 10;
- }
- }
-
- public function getLoc() : Point
- {
- return new Point(loc.x,loc.y);
- }
- }
- }
-
-