home *** CD-ROM | disk | FTP | other *** search
- class ShotHostile extends Shot
- {
- var flightTime;
- var acc;
- var ct;
- var bChopper;
- var velocity;
- var position;
- var screenPos;
- function ShotHostile(sLinkageId, pos, vel, newFlightTime)
- {
- super(sLinkageId,pos,vel);
- this.flightTime = newFlightTime;
- this.acc.x = 0;
- this.acc.y = -0.15;
- this.ct = null;
- this.bChopper = false;
- }
- function step(Void)
- {
- if(this.flightTime-- > 0)
- {
- this.velocity.x += this.acc.x;
- this.velocity.y += this.acc.y;
- this.position.x += this.velocity.x;
- this.position.y += this.velocity.y;
- if(this.screenPos.y < 50 || this.screenPos.y > Game.screenH || this.screenPos.x < -30 || this.screenPos.x > Game.screenW + 30)
- {
- Game.getInstance().removeHostileShot(this);
- }
- }
- else
- {
- Game.getInstance().createExplosion(this.position);
- Game.getInstance().removeHostileShot(this);
- }
- }
- }
-