home *** CD-ROM | disk | FTP | other *** search
- class Bullet extends MovieClip
- {
- var pos;
- var vel;
- var type;
- function Bullet()
- {
- super();
- this.pos = new flash.geom.Point();
- this.vel = new flash.geom.Point();
- }
- function step(plVel)
- {
- this.pos.x += this.vel.x;
- if(this.type == 0)
- {
- this.pos.y += this.vel.y;
- }
- else if(this.type == 1)
- {
- this.pos.y += - plVel.y;
- }
- if(this.pos.y > Game.screenH + 50)
- {
- Game.getInstance().removeShot();
- }
- if(this.pos.y < -50)
- {
- Game.getInstance().removeObstacle();
- }
- }
- function draw(Void)
- {
- this._x = this.pos.x;
- this._y = Game.screenH - this.pos.y;
- }
- }
-