Commits

Jake Albano committed ce7ae5c

Cleaned up input code;
Integrated everything with FLAkit;
Fixed horizontal collision with vertical walls;
Fixed bug where jumps were irregular while on platforms;

  • Participants

Comments (0)

Files changed (25)

+<?xml version="1.0" encoding="utf-8"?>
+<project version="2">
+  <!-- Output SWF options -->
+  <output>
+    <movie outputType="Application" />
+    <movie input="" />
+    <movie path="bin\FLAKit.swf" />
+    <movie fps="30" />
+    <movie width="800" />
+    <movie height="600" />
+    <movie version="10" />
+    <movie minorVersion="0" />
+    <movie platform="Flash Player" />
+    <movie background="#FFFFFF" />
+  </output>
+  <!-- Other classes to be compiled into your SWF -->
+  <classpaths>
+    <class path="src" />
+  </classpaths>
+  <!-- Build options -->
+  <build>
+    <option accessible="False" />
+    <option allowSourcePathOverlap="False" />
+    <option benchmark="False" />
+    <option es="False" />
+    <option locale="" />
+    <option loadConfig="" />
+    <option optimize="True" />
+    <option omitTraces="True" />
+    <option showActionScriptWarnings="True" />
+    <option showBindingWarnings="True" />
+    <option showInvalidCSS="True" />
+    <option showDeprecationWarnings="True" />
+    <option showUnusedTypeSelectorWarnings="True" />
+    <option strict="True" />
+    <option useNetwork="True" />
+    <option useResourceBundleMetadata="True" />
+    <option warnings="True" />
+    <option verboseStackTraces="False" />
+    <option linkReport="" />
+    <option loadExterns="" />
+    <option staticLinkRSL="True" />
+    <option additional="" />
+    <option compilerConstants="" />
+    <option minorVersion="" />
+  </build>
+  <!-- SWC Include Libraries -->
+  <includeLibraries>
+    <!-- example: <element path="..." /> -->
+  </includeLibraries>
+  <!-- SWC Libraries -->
+  <libraryPaths>
+    <!-- example: <element path="..." /> -->
+  </libraryPaths>
+  <!-- External Libraries -->
+  <externalLibraryPaths>
+    <!-- example: <element path="..." /> -->
+  </externalLibraryPaths>
+  <!-- Runtime Shared Libraries -->
+  <rslPaths>
+    <!-- example: <element path="..." /> -->
+  </rslPaths>
+  <!-- Intrinsic Libraries -->
+  <intrinsics>
+    <!-- example: <element path="..." /> -->
+  </intrinsics>
+  <!-- Assets to embed into the output SWF -->
+  <library>
+    <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
+  </library>
+  <!-- Class files to compile (other referenced classes will automatically be included) -->
+  <compileTargets>
+    <compile path="src\Game.as" />
+  </compileTargets>
+  <!-- Paths to exclude from the Project Explorer tree -->
+  <hiddenPaths>
+    <hidden path=".hg" />
+    <hidden path="License.txt" />
+  </hiddenPaths>
+  <!-- Executed before build -->
+  <preBuildCommand />
+  <!-- Executed after build -->
+  <postBuildCommand alwaysRun="False" />
+  <!-- Other project options -->
+  <options>
+    <option showHiddenPaths="False" />
+    <option testMovie="Default" />
+  </options>
+  <!-- Plugin storage -->
+  <storage />
+</project>
+<?xml version="1.0" encoding="utf-8"?>
+<!--Created with LibraryBuilder for FLAKit -->
+<!--http://www.thaumaturgistgames.com/FLAKit-->
+<library>
+    <images>
+        <image>horizontal.png</image>
+        <image>icicle.png</image>
+        <image>mage.png</image>
+        <image>rogue.png</image>
+        <image>shuriken.png</image>
+        <image>vertical.png</image>
+    </images>
+    <sounds />
+</library>

lib/LibraryBuilder.exe

Binary file added.

lib/horizontal.png

Added
New image

lib/icicle.png

Added
New image

lib/mage.png

Added
New image

lib/rogue.png

Added
New image

lib/shuriken.png

Added
New image

lib/vertical.png

Added
New image

obj/IfritConfig.old

+<?xml version="1.0" encoding="utf-8"?>
+<!--This Adobe Flex compiler configuration file was generated by a tool.-->
+<!--Any modifications you make may be lost.-->
+<flex-config>
+  <target-player>10.0</target-player>
+  <benchmark>false</benchmark>
+  <static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
+  <compiler>
+    <define append="true">
+      <name>CONFIG::debug</name>
+      <value>true</value>
+    </define>
+    <define append="true">
+      <name>CONFIG::release</name>
+      <value>false</value>
+    </define>
+    <define append="true">
+      <name>CONFIG::timeStamp</name>
+      <value>'10/29/2011'</value>
+    </define>
+    <verbose-stacktraces>true</verbose-stacktraces>
+    <source-path append="true">
+      <path-element>C:\Users\Jake\Documents\New folder\Ifrit\src</path-element>
+      <path-element>C:\Program Files (x86)\FlashDevelop\Library\AS3\classes</path-element>
+    </source-path>
+  </compiler>
+  <file-specs>
+    <path-element>C:\Users\Jake\Documents\New folder\Ifrit\src\Game.as</path-element>
+  </file-specs>
+  <default-background-color>#FFFFFF</default-background-color>
+  <default-frame-rate>30</default-frame-rate>
+  <default-size>
+    <width>800</width>
+    <height>600</height>
+  </default-size>
+</flex-config>

obj/IfritConfig.xml

+<?xml version="1.0" encoding="utf-8"?>
+<!--This Adobe Flex compiler configuration file was generated by a tool.-->
+<!--Any modifications you make may be lost.-->
+<flex-config>
+  <target-player>10.0</target-player>
+  <benchmark>false</benchmark>
+  <static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
+  <compiler>
+    <define append="true">
+      <name>CONFIG::debug</name>
+      <value>true</value>
+    </define>
+    <define append="true">
+      <name>CONFIG::release</name>
+      <value>false</value>
+    </define>
+    <define append="true">
+      <name>CONFIG::timeStamp</name>
+      <value>'10/29/2011'</value>
+    </define>
+    <verbose-stacktraces>true</verbose-stacktraces>
+    <source-path append="true">
+      <path-element>C:\Users\Jake\Documents\New folder\Ifrit\src</path-element>
+      <path-element>C:\Program Files (x86)\FlashDevelop\Library\AS3\classes</path-element>
+    </source-path>
+  </compiler>
+  <file-specs>
+    <path-element>C:\Users\Jake\Documents\New folder\Ifrit\src\Game.as</path-element>
+  </file-specs>
+  <default-background-color>#FFFFFF</default-background-color>
+  <default-frame-rate>30</default-frame-rate>
+  <default-size>
+    <width>800</width>
+    <height>600</height>
+  </default-size>
+</flex-config>

src/Bootloader.fla

Binary file added.
+package
+{
+	import com.jacobalbano.Input;
+	
+	import com.thaumaturgistgames.flakit.Engine;
+	
+	import flash.display.DisplayObject;
+	import flash.display.Sprite;
+	import flash.events.Event;
+	import flash.text.TextField;
+	import flash.utils.Timer;
+	import ifrit.*;
+	
+	
+	
+	
+	[SWF(width = "1000", height = "400", backgroundColor = "0xFFFFFF")]
+	public class Game extends Engine 
+	{
+		
+		public const MAX_X:uint = stage.stageWidth;
+		public const MIN_X:uint = 0;
+		public const MAX_Y:uint = stage.stageHeight;
+		public const MIN_Y:uint = 0;
+		
+		public var man:Sprite;
+		public var aProjectiles:Array = new Array();
+		public static var text:TextField = new TextField();
+		public var projectile:DisplayObject;
+		private var shootTimer:Timer = new Timer(0, 20);
+		
+		public function Game()	{}
+		
+		override public function init():void 
+		{
+			super.init();
+			
+			removeEventListener(Event.ADDED_TO_STAGE, init);
+			addEventListener(Event.ENTER_FRAME, enterFrame);
+			
+			Input.init(stage);
+			
+			man = new Man(50, 260);
+			addChild(man);
+			
+			addChild(new HorizontalWall(man, 250, 375, false));
+			addChild(new HorizontalWall(man, 450, 350, false));
+			addChild(new HorizontalWall(man, 170, 320, false));
+			addChild(new HorizontalWall(man, 30, 280, false));
+			addChild(new HorizontalWall(man, 310, 250, false));
+			addChild(new HorizontalWall(man, 640, 250, false));
+			addChild(new HorizontalWall(man, 700, 320, true));
+			
+			addChild(text);
+		}
+		
+		private function enterFrame(e:Event):void
+		{
+			if (Input.isKeyDown(Input.LEFT))
+			{
+				man.x -= 7;
+				man.rotationY = 180;
+			}
+			if (Input.isKeyDown(Input.RIGHT))
+			{
+				man.x += 7;
+				man.rotationY = 0;
+			}
+			
+			if (Input.isKeyDown(Input.SPACE))	Man.SB = true;
+			else Man.SB = false;
+			
+			if (Input.isKeyDown(Input.D)) // 'D' key
+			{
+				shootTiming();
+			}
+			
+			if (aProjectiles.length > 0)
+			{
+				for (var i:int = (aProjectiles.length - 1); i >= 0; i--)
+				{
+					projectile = aProjectiles[i];
+					
+					if (projectile.x > stage.stageWidth + 20 || projectile.x < MIN_X - 20)
+					{
+						projectile.parent.removeChild(projectile);
+						aProjectiles.splice(i, 1);
+					}
+				}
+			}
+		}
+		
+		private function shootTiming():void
+		{
+			if (shootTimer.currentCount == shootTimer.repeatCount) {  shootTimer.reset();  }
+			
+			if (!shootTimer.running)
+			{
+				if (man.rotationY == 180) {  stage.addChild(new Fireball(-10, man.x, man.y));  }
+				else if (man.rotationY == 0) {  stage.addChild(new Fireball(10, man.x, man.y));  }
+				
+				aProjectiles.push(stage.getChildAt(stage.numChildren - 1));
+				projectile = stage.getChildAt(stage.numChildren - 1);
+			}
+			shootTimer.start();
+		}
+		
+	}
+
+}

src/com/jacobalbano/Input.as

+package com.jacobalbano 
+{
+	import flash.display.Stage;
+	import flash.events.KeyboardEvent;
+	import flash.events.MouseEvent;
+	
+	/**
+	 * ...
+	 * @author Jake Albano
+	 */
+	
+	public class Input 
+	{
+		private static var _keyStates:Vector.<Boolean>;
+		private static var _mousePressed:Boolean;
+		private static var _mouseReleased:Boolean;
+		private static var _elapsed:Number;
+		private static var _stage:Stage;
+		
+		public function Input() {}
+		
+		/**
+		 * Called by engine
+		 */
+		public static function init(stage:Stage):void
+		{
+			_keyStates = new Vector.<Boolean>;
+			
+			for (var i:uint = 0; i < 127; i++)
+			{
+				_keyStates.push(false);
+			}
+			
+			_keyStates.fixed = true;
+			
+			_stage = stage;
+			
+			_stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
+			_stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
+			_stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
+			_stage.addEventListener(KeyboardEvent.KEY_UP, keyUp);
+		}
+		
+		private static function keyUp(e:KeyboardEvent):void 
+		{
+			_keyStates[e.keyCode] = false;
+		}
+		
+		private static function keyDown(e:KeyboardEvent):void 
+		{
+			_keyStates[e.keyCode] = true;
+		}
+		
+		private static function mouseDown(e:MouseEvent):void
+		{
+			_mousePressed = true;
+		}
+		
+		private static function mouseUp(e:MouseEvent):void
+		{
+			_mousePressed = false;
+		}
+		
+		public static function get isMouseDown():Boolean
+		{
+			return _mousePressed;
+		}
+		
+		/**
+		 * Returns the current X position of the mouse
+		 */
+		public static function get mouseX():Number
+		{
+			return _stage.mouseX;
+		}
+		
+		/**
+		 * Returns the current Y position of the mouse
+		 */
+		public static function get mouseY():Number
+		{
+			return _stage.mouseY;
+		}
+		
+		
+		public static function isKeyDown(key:int):Boolean
+		{
+			return _keyStates[key];
+		}
+		
+		public static const LEFT:int = 37;
+		public static const UP:int = 38;
+		public static const RIGHT:int = 39;
+		public static const DOWN:int = 40;
+		
+		public static const ENTER:int = 13;
+		public static const CONTROL:int = 17;
+		public static const SPACE:int = 32;
+		public static const SHIFT:int = 16;
+		public static const BACKSPACE:int = 8;
+		public static const CAPS_LOCK:int = 20;
+		public static const DELETE:int = 46;
+		public static const END:int = 35;
+		public static const ESCAPE:int = 27;
+		public static const HOME:int = 36;
+		public static const INSERT:int = 45;
+		public static const TAB:int = 9;
+		public static const PAGE_DOWN:int = 34;
+		public static const PAGE_UP:int = 33;
+		public static const LEFT_SQUARE_BRACKET:int = 219;
+		public static const RIGHT_SQUARE_BRACKET:int = 221;
+		
+		public static const A:int = 65;
+		public static const B:int = 66;
+		public static const C:int = 67;
+		public static const D:int = 68;
+		public static const E:int = 69;
+		public static const F:int = 70;
+		public static const G:int = 71;
+		public static const H:int = 72;
+		public static const I:int = 73;
+		public static const J:int = 74;
+		public static const K:int = 75;
+		public static const L:int = 76;
+		public static const M:int = 77;
+		public static const N:int = 78;
+		public static const O:int = 79;
+		public static const P:int = 80;
+		public static const Q:int = 81;
+		public static const R:int = 82;
+		public static const S:int = 83;
+		public static const T:int = 84;
+		public static const U:int = 85;
+		public static const V:int = 86;
+		public static const W:int = 87;
+		public static const X:int = 88;
+		public static const Y:int = 89;
+		public static const Z:int = 90;
+		
+		public static const F1:int = 112;
+		public static const F2:int = 113;
+		public static const F3:int = 114;
+		public static const F4:int = 115;
+		public static const F5:int = 116;
+		public static const F6:int = 117;
+		public static const F7:int = 118;
+		public static const F8:int = 119;
+		public static const F9:int = 120;
+		public static const F10:int = 121;
+		public static const F11:int = 122;
+		public static const F12:int = 123;
+		public static const F13:int = 124;
+		public static const F14:int = 125;
+		public static const F15:int = 126;
+		
+		public static const DIGIT_0:int = 48;
+		public static const DIGIT_1:int = 49;
+		public static const DIGIT_2:int = 50;
+		public static const DIGIT_3:int = 51;
+		public static const DIGIT_4:int = 52;
+		public static const DIGIT_5:int = 53;
+		public static const DIGIT_6:int = 54;
+		public static const DIGIT_7:int = 55;
+		public static const DIGIT_8:int = 56;
+		public static const DIGIT_9:int = 57;
+		
+		public static const NUMPAD_0:int = 96;
+		public static const NUMPAD_1:int = 97;
+		public static const NUMPAD_2:int = 98;
+		public static const NUMPAD_3:int = 99;
+		public static const NUMPAD_4:int = 100;
+		public static const NUMPAD_5:int = 101;
+		public static const NUMPAD_6:int = 102;
+		public static const NUMPAD_7:int = 103;
+		public static const NUMPAD_8:int = 104;
+		public static const NUMPAD_9:int = 105;
+		public static const NUMPAD_ADD:int = 107;
+		public static const NUMPAD_DECIMAL:int = 110;
+		public static const NUMPAD_DIVIDE:int = 111;
+		public static const NUMPAD_ENTER:int = 108;
+		public static const NUMPAD_MULTIPLY:int = 106;
+		public static const NUMPAD_SUBTRACT:int = 109;
+		
+	}
+
+}

src/com/thaumaturgistgames/flakit/Engine.as

+package com.thaumaturgistgames.flakit
+{
+	import flash.display.MovieClip;
+	import flash.events.Event;
+	
+	/**
+	 * FLAKit bootloader
+	 * @author Jake Albano
+	 */
+	
+	public class Engine extends MovieClip
+	{
+		public function Engine():void 
+		{
+			if (stage) load();
+			else addEventListener(Event.ADDED_TO_STAGE, load);
+		}
+		
+		private function load(e:Event = null):void 
+		{
+			removeEventListener(Event.ADDED_TO_STAGE, load);
+			addEventListener(Event.ENTER_FRAME, loadLibrary);
+			
+			Library.init(stage, Library.IMAGE | Library.AUDIO);
+		}
+		
+		private function loadLibrary(e:Event):void 
+		{
+			beginLoadingScreen();
+			
+			if (Library.loaded)
+			{
+				removeEventListener(Event.ENTER_FRAME, loadLibrary);
+				init();
+			}
+		}
+		
+		public function init():void
+		{
+			endLoadingScreen();
+			
+			//	Entry point
+		}
+		
+		public function beginLoadingScreen():void 
+		{
+			//	Override this
+		}
+		
+		
+		public function endLoadingScreen():void 
+		{
+			//	Override this
+		}
+		
+	}
+	
+}

src/com/thaumaturgistgames/flakit/ImageLoader.as

+package com.thaumaturgistgames.flakit
+{
+import flash.display.Loader;
+import flash.events.Event;
+import flash.net.URLRequest;
+
+	public class ImageLoader
+    {
+		private var filename:String;
+		private var imgStream:Loader;
+		
+		/**
+		 * Load image from file location
+		 * @param	imageURL	The name of the file to load
+		 */
+		public function ImageLoader(imageURL:String)
+        {
+			imgStream = new Loader();
+			imgStream.contentLoaderInfo.addEventListener(Event.COMPLETE, imageHandler);
+			imgStream.load(new URLRequest("../lib/" + imageURL));
+			this.filename = imageURL;
+        }
+
+		private function imageHandler(e:Event):void
+        {
+			imgStream.removeEventListener(Event.COMPLETE, imageHandler);
+			Library.addImage(this.filename.split("/").join("."), e.target.content);
+        }
+    }
+}

src/com/thaumaturgistgames/flakit/Library.as

+package com.thaumaturgistgames.flakit
+{
+	import flash.display.Bitmap;
+	import flash.display.Stage;
+	import flash.events.Event;
+	import flash.media.Sound;
+	import XML;
+	
+	public class Library 
+	{
+		
+		private static var loadFlags:int;
+		private static var totalImages:uint;
+		private static var totalSounds:uint;
+		private static var loadedImages:uint;
+		private static var loadedSounds:uint;
+		private static var _loaded:Boolean = false;
+		private static var imageResources:Vector.<imageResource>;
+		private static var soundResources:Vector.<soundResource>;
+		private static var isInitialized:Boolean;
+		private static var stage:Stage;
+		private static var loader:XMLLoader;
+		
+		public function Library() 
+		{
+			//	Pure static classes cannot be created as objects
+			throw new Error("Cannot instantiate the Library class!");
+		}
+		
+		/**
+		 * Initialize the Library so it can be accessed
+		 * @param	s		A reference to the stage, for internal event management
+		 * @param	flags	Which components to initialize
+		 */
+		public static function init(s:Stage, flags:int):void
+		{
+			stage = s;
+			
+			imageResources = new Vector.<imageResource>;
+			soundResources = new Vector.<soundResource>;
+			
+			totalImages = 0;
+			loadedImages = 0;
+			
+			totalSounds = 0;
+			loadedSounds = 0;
+			
+			loadFlags = flags;
+			
+			stage.addEventListener(Event.ENTER_FRAME, xmlLoaded);
+			
+			loader = new XMLLoader;
+			
+			isInitialized = true;
+		}
+		
+		/**
+		 * Add a new image to the library
+		 * @param	name	The image identifier
+		 * @param	image	The Bitmap to add
+		 */
+		public static function addImage(name:String, image:Bitmap):void
+		{
+			checkInit();
+			
+			imageResources.push(new imageResource(image, name));
+			loadedImages++;
+		}
+		
+		/**
+		 * Add a new sound to the library
+		 * @param	name	The sound identifier
+		 * @param	sound	The sound to add
+		 */
+		public static function addSound(name:String, sound:Sound):void
+		{
+			checkInit();
+			
+			soundResources.push(new soundResource(sound, name));
+			loadedSounds++;
+		}
+		
+		/**
+		 * Retrive an image loaded at runtine
+		 * @param	name	The filename of the image to load
+		 * @return			A bitmap object loaded at runtime
+		 */
+		public static function IMG(name:String):Bitmap
+		{
+			checkInit();
+			
+			for each (var item:imageResource in imageResources) 
+			{
+				if (item.name == name) return new Bitmap(item.image.bitmapData);
+			}
+			
+			throw new Error("The image \"" + name + "\" does not exist in the library.");
+		}
+		
+		public static function SND(name:String):Sound
+		{
+			checkInit();
+			
+			for each (var item:soundResource in soundResources) 
+			{
+				if (item.name == name) return item.sound;
+			}
+			
+			throw new Error("The image \"" + name + "\" does not exist in the library.");
+		}
+		
+		/**
+		 * Whether all media has been loaded into the Library
+		 */
+		public static function get loaded():Boolean
+		{
+			checkInit();
+			
+			return _loaded;
+		}
+		
+		/**
+		 * The load status of the Library, for loading screens
+		 */
+		public static function get loadPercentage():Number
+		{
+			checkInit();
+			
+			var result:Number = loadedImages + loadedSounds / totalImages + totalSounds * 100;
+			return isNaN(result) ? 0 : result;
+		}
+		
+		public static const IMAGE:int = 2;
+		public static const AUDIO:int = 4;
+		
+		//	Listeners
+		static private function imagesLoaded(e:Event):void 
+		{
+			_loaded = (totalImages == imageResources.length && totalSounds == soundResources.length);
+		}
+		
+		private static function xmlLoaded(e:Event):void
+		{
+			if (loader.loaded)
+			{
+				stage.removeEventListener(Event.ENTER_FRAME, xmlLoaded);
+				
+				if ((loadFlags & IMAGE) > 0)
+				{
+					for each (var imagename:XML in loader.XMLData.images.image) 
+					{
+						new ImageLoader(imagename);
+						totalImages++;
+					}
+				}
+				
+				if ((loadFlags & AUDIO) > 0)
+				{
+					for each (var soundname:XML in loader.XMLData.sounds.sound) 
+					{
+						new SoundLoader(soundname);
+						totalSounds++;
+					}
+				}
+				
+				stage.addEventListener(Event.ENTER_FRAME, imagesLoaded);
+			}
+		}
+		
+		//	Make sure Library.init(stage) has been called already
+		private static function checkInit():void
+		{
+			
+			if (!isInitialized)		throw new Error("Library hasn't been initialized!");
+		}
+		
+	}
+
+}

src/com/thaumaturgistgames/flakit/SoundLoader.as

+package com.thaumaturgistgames.flakit
+{
+	import flash.events.Event;
+	import flash.media.Sound;
+	import flash.net.URLRequest;
+
+	public class SoundLoader
+    {
+		private var filename:String;
+		private var sndStream:URLRequest;
+		private var sound:Sound;
+		
+		/**
+		 * Load sound from file location
+		 * @param	soundURL	The name of the file to load
+		 */
+		public function SoundLoader(soundURL:String)
+        {
+			sndStream = new URLRequest("../lib/" + soundURL);
+			sound = new Sound(sndStream);
+			sound.addEventListener(Event.COMPLETE, soundHandler);
+			this.filename = soundURL;
+        }
+
+		private function soundHandler(e:Event):void
+        {
+			sound.removeEventListener(Event.COMPLETE, soundHandler);
+			Library.addSound(this.filename.split("/").join("."), sound);
+        }
+    }
+}

src/com/thaumaturgistgames/flakit/XMLLoader.as

+package com.thaumaturgistgames.flakit
+{
+	import flash.events.Event;
+	import flash.events.ProgressEvent;
+	import flash.net.URLLoader;
+	import flash.net.URLRequest;
+	
+    public class XMLLoader
+    {
+        private var loader:URLLoader = new URLLoader(new URLRequest("../lib/library.xml"));
+		
+		public var XMLData:XML;
+		public var loaded:Boolean;
+    
+        public function XMLLoader()
+        {
+            loader.addEventListener(Event.ACTIVATE, onActivated);
+            loader.addEventListener(Event.COMPLETE, onComplete);
+            loader.addEventListener(ProgressEvent.PROGRESS, onProgress);
+        }
+    
+        private function onActivated(event:Event):void
+        {
+            //trace("Load of XML library initialized.");
+        }
+    
+        private function onComplete(event:Event):void
+        {
+            //trace("Load of XML library complete.");
+						
+			XMLData = new XML(loader.data);
+			loaded = true;
+        }
+    
+        private function onProgress(event:Event):void
+        {
+            //trace("Load of XML library progress:", loader.bytesLoaded, "out of", loader.bytesTotal, "bytes.");
+        }
+    }
+}

src/com/thaumaturgistgames/flakit/imageResource.as

+package com.thaumaturgistgames.flakit
+{
+	import flash.display.Bitmap;
+	
+	/**
+	 * Helper class to store a string/bitmap pair
+	 */
+	public class imageResource 
+	{
+		public var image:Bitmap;
+		public var name:String;
+		
+		public function imageResource(image:Bitmap, name:String) 
+		{
+			this.image = image;
+			this.name = name;
+		}
+		
+	}
+
+}

src/com/thaumaturgistgames/flakit/soundResource.as

+package com.thaumaturgistgames.flakit
+{
+	import flash.media.Sound;
+	
+	/**
+	 * Helper class to store a string/sound pair
+	 */
+	public class soundResource 
+	{
+		public var sound:Sound;
+		public var name:String;
+		
+		public function soundResource(sound:Sound, name:String) 
+		{
+			this.sound = sound;
+			this.name = name;
+		}
+		
+	}
+
+}

src/ifrit/Fireball.as

+package ifrit 
+{
+	import com.thaumaturgistgames.flakit.Library;
+	
+	import flash.display.Bitmap;
+	import flash.display.Sprite;
+	import flash.events.Event;
+	/**
+	 * ...
+	 * @author Chris Logsdon
+	 */
+	public class Fireball extends Sprite
+	{		
+		public var fireball:Bitmap = Library.IMG("shuriken.png");
+		public var fireballC:Sprite = new Sprite();
+		
+		private var dx:int;
+		
+		public function Fireball(direction:int, x:Number, y:Number) 
+		{
+			addChild(fireballC);
+			
+			fireballC.x = fireball.x - (fireball.width / 2);
+			fireballC.y = fireball.y - (fireball.height / 2);
+			
+			fireballC.addChild(fireball);
+			
+			dx = direction;
+			this.x = x;
+			this.y = y;
+			
+			addEventListener(Event.ENTER_FRAME, enterFrame);
+		}
+		
+		private function enterFrame(e:Event):void 
+		{
+			this.x += dx;
+			if (dx < 0) { this.rotation -= 20; }
+			else if (dx > 0) { this.rotation += 20; }
+		}
+		
+	}
+
+}

src/ifrit/HorizontalWall.as

+package ifrit 
+{
+	import com.thaumaturgistgames.flakit.Library;
+	
+	import flash.display.Bitmap;
+	import flash.display.DisplayObject;
+	import flash.display.Sprite;
+	import flash.events.Event;
+	
+	public class HorizontalWall extends Sprite
+	{		
+		public var hWall:Bitmap = Library.IMG("horizontal.png");
+		public var hWallC:Sprite = new Sprite();
+		
+		private var obj:DisplayObject;
+		
+		public function HorizontalWall(object:DisplayObject, x:Number, y:Number, vertical:Boolean) 
+		{
+			addChild(hWallC);
+			
+			hWallC.x = hWall.x - (hWall.width / 2);
+			hWallC.y = hWall.y - (hWall.height / 2);
+			
+			this.x = x;
+			this.y = y;
+			
+			//TODO: Change how hor/ver walls are done?
+			/*
+			 * Make a Horizontal and Vertical wall class, and instantiate them within one Wall class?  
+			 */
+			if (vertical) this.rotation = 90;
+			else this.rotation = 0;
+			
+			hWallC.addChild(hWall);
+			
+			obj = object;
+			
+			addEventListener(Event.ENTER_FRAME, enterFrame);
+		}
+		
+		private function enterFrame(e:Event):void 
+		{
+			var objHalfW:Number = obj.width / 2;
+			var objHalfH:Number = obj.height / 2;
+			var thisHalfW:Number = this.width / 2;
+			var thisHalfH:Number = this.height / 2;
+			
+			var dx:Number = this.x - obj.x; // Distance between objects (X)
+			var dy:Number = obj.y - this.y; // Distance between objects (Y)
+			
+			var ox:Number = (thisHalfW + objHalfW) - Math.abs(dx); // Overlap on X axis
+			var oy:Number = (thisHalfH + objHalfH) - Math.abs(dy); // Overlap on Y axis
+			
+			if (this.hitTestObject(obj))
+			{
+				if (this.rotation == 0)
+				{
+					if (obj.y <= this.y) // top
+					{
+						obj.y -= oy;
+						Man.gravUp = false;
+						Man.jumpTimer.reset();
+					}
+					else if (obj.y >= this.y) // bottom
+					{
+						obj.y += oy;
+						(obj as Man).jumpReset();
+					}
+					else if (obj.x <= this.x) obj.x -= ox; // left
+					else if (obj.x >= this.x) obj.x += ox; // right
+				}
+				else 
+				{
+					if (obj.x <= this.x) obj.x -= ox; // left
+					else if (obj.x >= this.x) obj.x += ox; // right
+					else if (obj.y <= this.y) // top
+					{
+						obj.y -= oy;
+						Man.gravUp = false;
+						Man.jumpTimer.reset();
+					}
+					else if (obj.y >= this.y) // bottom
+					{
+						obj.y += oy;
+						(obj as Man).jumpReset();
+					}
+				}
+			}
+			
+			//trace("obj x: " + obj.x);
+			//trace("obj y: " + obj.y);
+			//trace("ox: " + ox);
+			//trace("oy: " + oy);
+			//trace("dx: " + dx);
+			//trace("dy: " + Math.abs(dy));
+			//trace("objHalfW: " + objHalfW);
+			//trace("objHalfH: " + objHalfH);
+			//trace("thisHalfW: " + thisHalfW);
+			//trace("thisHalfH: " + thisHalfH);
+			//trace("this x: " + this.x);
+			//trace("this y: " + this.y);
+			//trace("----------------------");
+		} // end enter frame
+	}
+}
+
+//BUG: Strange results if player touching >1 platform at a time
+/*
+ * 
+ */
+package ifrit 
+{
+	import com.thaumaturgistgames.flakit.Library;
+	
+	import flash.display.Sprite;
+	import flash.display.Bitmap;
+	import flash.events.Event;
+	import flash.utils.Timer;
+	
+	/**
+	 * ...
+	 * @author Chris Logsdon
+	 */
+	public class Man extends Sprite
+	{		
+		private var man:Bitmap = Library.IMG("rogue.png");
+		private var manC:Sprite = new Sprite;
+		
+		private var vx:Number;
+		private var vy:Number;
+		private var speedLimit:Number;
+		
+		public static var gravity:Number;
+		
+		public static var L:Boolean;
+		public static var R:Boolean;
+		public static var SB:Boolean; // spacebar
+		
+		public static var jumpTimer:Timer = new Timer(0, 2);
+		
+		public static var gravUp:Boolean;
+		
+		public function Man(x:Number, y:Number) 
+		{
+			addChild(manC);
+			manC.x = man.x - (man.width / 2); // Set registration point to center
+			manC.y = man.y - (man.height / 2);
+			man.smoothing = true;
+			manC.addChild(man);
+			
+			this.x = x;
+			this.y = y;
+			
+			vx = 0;
+			vy = 0;
+			speedLimit = 7;
+			gravity = 1;
+			
+			addEventListener(Event.ENTER_FRAME, onEnterFrame);
+		}
+		
+		//TODO: Make vy static var and reset from HorizontalWall class?
+		/*
+		 * Took out any tweaking of Man.jumpTimer() because it either reset at an
+		 * inappropriate time, or it never reached it's repeat count (2). This cause the
+		 * sticking to bottoms of platforms while Spacebar was down. In order to jump,
+		 * the following must be true: currentCount < repeatCount. (see enter frame function).
+		 */
+		public function jumpReset():void
+		{
+			vy = 0;
+		}
+		
+		
+		//BUG: Upward thrust when player hits corner of platform
+		private function onEnterFrame(e:Event):void
+		{
+			if (gravUp)	vy += gravity;
+			else vy = 0;
+			
+			// Jump(rise) until spacebar up or until timer ends.
+			if (SB && jumpTimer.currentCount < jumpTimer.repeatCount)
+			{
+				if (!jumpTimer.running) {  jumpTimer.start();  }
+				
+				vy += -5;
+				
+				if (vx >= speedLimit) {	vx = speedLimit; }
+				if (vx < -speedLimit) {	vx = -speedLimit; }
+				if (vy >= speedLimit) {	vy = speedLimit; }
+				if (vy < -speedLimit) {	vy = -speedLimit; }
+				
+			}
+			if (jumpTimer.currentCount == jumpTimer.repeatCount) {  jumpTimer.stop();  }
+			
+			// Apply physics to player movement
+			this.x += vx;
+			this.y += vy;
+			
+			// Stage boundaries
+			var thisHalfW:uint = (this.width / 2);
+			var thisHalfH:uint = (this.height / 2);
+			if (this.x + thisHalfW > stage.stageWidth) {  this.x = stage.stageWidth - thisHalfW;  }
+			if (this.x - thisHalfW < 0) {  this.x = 0 + thisHalfW;  }
+			if (this.y + thisHalfH > stage.stageHeight)
+			{
+				vx = 0;
+				vy = 0;
+				this.y = stage.stageHeight - thisHalfH;
+				
+				jumpTimer.reset(); // Reset when on floor, to avoid constant jumping in air
+			}
+			if (this.y - thisHalfH < 0)
+			{
+				vx = 0;
+				vy = 0;
+				this.y = 0 + thisHalfH;
+			}
+			
+			gravUp = true;
+		} // End enter frame
+	}
+}

src/ifrit/VerticalWall.as

+package ifrit 
+{
+	import flash.display.Bitmap;
+	import flash.display.Sprite;
+	
+	public class VerticalWall extends Sprite
+	{
+		[Embed(source = "../../lib/vertical.png")] public const VERTICAL:Class;
+		
+		public var vWall:Bitmap = new VERTICAL;
+		public var vWallC:Sprite = new Sprite();
+		
+		public function VerticalWall() 
+		{
+			addChild(vWallC);
+			
+			vWallC.x = vWall.x - (vWall.width / 2);
+			vWallC.y = vWall.y - (vWall.height / 2);
+			
+			vWallC.addChild(vWall);
+		}
+		
+	}
+
+}