home *** CD-ROM | disk | FTP | other *** search
- package asCode
- {
- import flash.geom.Point;
-
- public class visualBubble
- {
- 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 life:int;
-
- private var hitTestRadius:int = 30;
-
- private var id:int;
-
- private var enemyType:int;
-
- private var scale: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 visualBubble(param1:Number, param2:Number, param3:Number)
- {
- super();
- loc = new Point(param1,param2);
- dir = param3 + Math.random() * 10 - 5;
- speed = Math.random() * 20 + 5;
- radians = dir / 180 * Math.PI;
- scale = Math.random() + 0.75;
- remove = false;
- life = 30;
- }
-
- public function getLife() : int
- {
- return life;
- }
-
- public function getScale() : Number
- {
- return scale;
- }
-
- public function getType() : int
- {
- return enemyType;
- }
-
- public function manageVisualBubble() : void
- {
- --life;
- speed *= 0.9;
- xVel = Math.cos(radians) * speed;
- yVel = Math.sin(radians) * speed;
- loc.x += xVel;
- loc.y += yVel;
- }
-
- 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 getLoc() : Point
- {
- return new Point(loc.x,loc.y);
- }
- }
- }
-
-