home *** CD-ROM | disk | FTP | other *** search
- package com.lofiminds.xwung
- {
- import com.lofiminds.gm.GameObject;
- import com.lofiminds.gm.GameUtil;
- import com.lofiminds.gm.Instances;
-
- public class Explosion extends GameObject
- {
-
-
- private var dirAdd:Number;
-
- private var count:Number;
-
- public function Explosion()
- {
- super();
- depth = 1;
- dirAdd = GameUtil.degToRad(GameUtil.randomRange(0,25));
- count = GameUtil.randomRange(10,5);
- }
-
- override public function getClass() : Class
- {
- return Explosion;
- }
-
- override public function update() : void
- {
- super.update();
- if(count > 0)
- {
- --count;
- setSpeedAndDirection(this.getSpeed(),getDirection() + dirAdd);
- Instances.create(Blip,x,y);
- }
- else
- {
- Instances.destroy(this);
- }
- }
- }
- }
-