Com

camera
interfaces
levels
myMath
physics
weapons

globalFunctions

package com{
    import flash.display.MovieClip;
    import com.levels.level;
    import com.globals;
    import flash.display.DisplayObject;
    public class globalFunctions {

        public function globalFunctions():void {
        }
        public static function getY(obj:Object):int {
            var yVar:int=obj.y;
            var parentObj:DisplayObject=obj.parent;
            while (parentObj!=globals.main.parent) {
                yVar+=parentObj.y;
                parentObj=parentObj.parent;
            }
            return yVar;
        }
        public static function getX(obj:Object):int {
            var xVar:int=obj.x;
            var parentObj:DisplayObject=obj.parent;
            while (parentObj!=globals.main.parent) {
                xVar+=parentObj.x;
                parentObj=parentObj.parent;
            }
            return xVar;
        }
        public static function makeY(obj:Object, desire:int):int {
            var parentObj:DisplayObject=obj.parent;
            while (parentObj!=globals.main) {
                desire-=parentObj.y;
                parentObj=parentObj.parent;
            }
            return desire;
        }
        public static function makeX(obj:Object, desire:int):int {
            var parentObj:DisplayObject=obj.parent;
            while (parentObj!=globals.main) {
                desire-=parentObj.x;
                parentObj=parentObj.parent;
            }
            return desire;
        }
    }
}

globals

package com{
    import flash.display.MovieClip;
    import com.levels.level;
    import com.camera.Cam;
    public class globals {
        public static var HUD:Cam;
        public static var camSpeed:int;
        public static var main:MovieClip;
        public static var gravity:Number;
        public static var levelObj:MovieClip;
        public static var fric:Number;
        public static var hero:Hero;
            public static var gameWidth:int=800;
            public static var gameHeight:int=600;
        public function globals():void {
        }
        public static function setVars():void {
            globals.fric=.9;
        }
        public static function setMain(main:MovieClip):void {
            globals.main=main;
        }
        public static function setGravity(gravity:Number):void {
            globals.gravity=gravity;
        }
        public static function setLevel(levelObj:level):void {
            globals.levelObj=levelObj;
        }
        public static function setHero(hero:Hero):void {
            globals.hero=hero;
        }
        public static function setCam(HUD:Cam, camSpeed:int):void {
            globals.camSpeed=camSpeed;
            globals.HUD=HUD;
        }
    }
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License