Weapons

jetPack

package com.weapons{
    import com.interfaces.jetPackInterface;
    import flash.display.MovieClip;
    public class jetPack {
        private var user:jetPackInterface;
        private var fuel:int;
        private var totalFuel:int;
        private var strength:Number;
        private var startStrength:Number;
        public function jetPack(user:jetPackInterface):void {
            this.user=user;
            totalFuel=500;
            strength=-1.8;
            startStrength=-4;
            fuel=totalFuel;
        }
        public function jetPackIgnite():void {
            if(fuel==0){
                user.noFuel();
            }else{
                Object(user).modifySpeedY(strength);
            }
        }
        public function ignition():void {
            Object(user).modifySpeedY(startStrength);
        }
    }
}

missile

package com.weapons{
    import com.globals;
    public class missile extends projectile{
        private var hitCheck:pointOfDamage;
        public function missile(Angle:int, Speed:Number):void {
            this.Speed=Speed;
            this.Angle=Angle;
            hitCheck=new pointOfDamage(this, globals.levelObj.ground);
        }
    }
}

pointOfDamage

package com.weapons {
    import com.globals;
    import flash.events.Event;
    import flash.display.DisplayObject;
    import flash.display.MovieClip;
    public class pointOfDamage {
        private var secondaryHitCheck:DisplayObject;
        private var parentObj:DisplayObject;
        private var xVar:int;
        private var yVar:int;
        public function pointOfDamage(parentObj:DisplayObject,secondaryHitCheck:DisplayObject):void {
            this.parentObj=parentObj;
            this.secondaryHitCheck=secondaryHitCheck;
            //addEventListener(Event.ENTER_FRAME, checkForHit, false, 0, true);
        }
        private function checkForHit(e:Event):void {
            xVar=parentObj.x
            yVar=parentObj.y
            if(globals.levelObj.ground.hitTestPoint(xVar, yVar, true)){
                if(secondaryHitCheck.hitTestPoint(xVar, yVar, true)){
                }
            }
        }
    }
}

projectile

package com.weapons {
    import com.globals;
    import com.physics.gravity;
    import flash.events.Event;
    public class projectile extends gravity{
        protected var Angle:int;
        public function projectile():void {
            addEventListener(Event.ENTER_FRAME, movement, false, 0, true);
        }
        private function movement(e:Event):void {
        }
    }
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License