Commits

Jake Albano committed 5fb170e

New Mob class that both Enemy and Player extend;
Changed names of classes Man -> Player and HorizontalWall -> Platform;
Removed VerticalWall as it is now redundant;
Added Rules class for static variables such as gravity;
Removed the static modifier from all variables in Player;
Enemy patrols the platform he stands on until he reaches an edge or an obstacle;
Projectiles now collide with walls and enemies;

Comments (0)

Files changed (12)

obj/IfritConfig.old

     </define>
     <define append="true">
       <name>CONFIG::timeStamp</name>
-      <value>'10/29/2011'</value>
+      <value>'10/31/2011'</value>
     </define>
     <verbose-stacktraces>true</verbose-stacktraces>
     <source-path append="true">

obj/IfritConfig.xml

     </define>
     <define append="true">
       <name>CONFIG::timeStamp</name>
-      <value>'10/29/2011'</value>
+      <value>'10/31/2011'</value>
     </define>
     <verbose-stacktraces>true</verbose-stacktraces>
     <source-path append="true">
 package
 {
 	import com.jacobalbano.Input;
+	import com.thaumaturgistgames.flakit.Engine;
+	import flash.display.DisplayObject;
+	import ifrit.*;
 	
-	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.*;
-	
+	import flash.geom.Point;
 	
 	
 	
 	[SWF(width = "1000", height = "400", backgroundColor = "0xFFFFFF")]
 	public class Game extends Engine 
 	{
+		public static var text:TextField = new TextField();
 		
 		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 var man:Player;
+		public static var Projectiles:Vector.<Fireball>;
+		public static var Mobs:Vector.<Mob>;
+		public static var Platforms:Vector.<Platform>;
 		
 		public function Game()	{}
 		
 			
 			Input.init(stage);
 			
-			man = new Man(50, 260);
-			addChild(man);
+			Platforms = new Vector.<Platform>;
+			Projectiles = new Vector.<Fireball>;
+			Mobs = new Vector.<Mob>;
 			
-			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));
+			Mobs.push(stage.addChild(man = new Player(50, 260)) as Mob);
+			
+			addEnemy(250, 375);
+			addEnemy(450, 350);
+			addEnemy(170, 320);
+			addEnemy(30, 280);
+			addEnemy(310, 250);		
+			addEnemy(640, 250);	
+			
+			addWall(250, 375, false);
+			addWall(450, 350, false);
+			addWall(170, 320, false);
+			addWall(30, 280, false);
+			addWall(310, 250, false);
+			addWall(640, 250, false);
+			addWall(700, 320, true);
 			
 			addChild(text);
 		}
 				man.rotationY = 0;
 			}
 			
-			if (Input.isKeyDown(Input.SPACE))	Man.SB = true;
-			else Man.SB = false;
+			if (Input.isKeyDown(Input.SPACE))
+			{
+				man.jumping = true;
+			}
+			else man.jumping = false;
 			
-			if (Input.isKeyDown(Input.D)) // 'D' key
+			if (Input.isKeyDown(Input.D) )
 			{
-				shootTiming();
+				man.shoot();
 			}
 			
-			if (aProjectiles.length > 0)
+			if (Mobs.length > 0)
 			{
-				for (var i:int = (aProjectiles.length - 1); i >= 0; i--)
+				for (var l:int = Mobs.length - 1; l >= 0; l--)
 				{
-					projectile = aProjectiles[i];
+					if (Projectiles.length > 0)
+					{						
+						for (var k:int = Projectiles.length - 1; k >= 0; k--) 
+						{
+							if (Point.distance(new Point(Mobs[l].x, Mobs[l].y), new Point(Projectiles[k].x, Projectiles[k].y) ) <= Projectiles[k].width / 2)
+							{
+								if (Projectiles[k].friendly != Mobs[l].friendly)
+								{
+									stage.removeChild(Projectiles[k]);
+									Projectiles.splice(k, 1);
+									
+									Mobs[l].destroy();
+									stage.removeChild(Mobs[l]);
+									Mobs.splice(l, 1);
+									trace("hit");
+									continue;
+								}
+							}
+						}
+					}
+				}	
+			}
+			
+			if (Platforms.length > 0)
+			{
+				for (var ii:int = Platforms.length - 1; ii >= 0; ii--)
+				{
+					if (Projectiles.length > 0)
+					{						
+						for (var j:int = Projectiles.length - 1; j >= 0; j--) 
+						{
+							if (Projectiles[j].x > stage.stageWidth + 20 || Projectiles[j].x < MIN_X - 20)
+							{
+								stage.removeChild(Projectiles[j]);
+								Projectiles.splice(j, 1);
+								continue;
+							}
+							
+							if (Platforms[ii].collide(Projectiles[j] ) )
+							{
+								stage.removeChild( Projectiles[j] );
+								Projectiles.splice(j, 1);
+								continue;
+							}
+						}
+					}
 					
-					if (projectile.x > stage.stageWidth + 20 || projectile.x < MIN_X - 20)
+					if (Mobs.length > 0)
 					{
-						projectile.parent.removeChild(projectile);
-						aProjectiles.splice(i, 1);
+						for (var jj:int = Mobs.length - 1; jj >= 0; jj--) 
+						{
+							Platforms[ii].collide(Mobs[jj] );
+						}
 					}
 				}
 			}
+			
 		}
 		
-		private function shootTiming():void
+		private function addWall(x:Number, y:Number, vertical:Boolean):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();
+			Platforms.push(	addChild(new Platform(x, y, vertical) ) );
+		}
+		
+		private function addEnemy(x:Number, y:Number):void
+		{
+			Mobs.push(stage.addChild(new Enemy(x, y) ) as Mob);		
 		}
 		
 	}

src/ifrit/Enemy.as

+package ifrit 
+{
+	import com.thaumaturgistgames.flakit.Library;
+	import flash.geom.Point;
+	
+	import flash.display.Sprite;
+	import flash.display.Bitmap;
+	import flash.events.Event;
+	import flash.utils.Timer;
+	
+	/**
+	 * @author Jake Albano
+	 */
+	public class Enemy extends Mob 
+	{
+		//	Which way the enemy patrols
+		//	If true, right, else left
+		public var heading:Boolean;
+		private var rightBound:Number;
+		private var leftBound:Number;
+		private var lastPosition:Point;
+		private var speed:Number;
+		
+		public function Enemy(x:Number, y:Number) 
+		{
+			super(x, y, Library.IMG("mage.png") );
+			this.lastPosition = new Point(x, y);
+			this.heading = true;
+			this.heading = Boolean(Math.round(Math.random()));
+			this.speed = Math.random();
+		}
+		
+		override public function think():void 
+		{
+			super.think();
+			this.rotationY = this.heading ? 0 : 180;
+			
+			for (var i:int = 0; i < Game.Platforms.length; i++) 
+			{
+				if (Game.Platforms[i].collide(this))
+				{
+					leftBound = Game.Platforms[i].x + this.width / 2 - Game.Platforms[i].width / 2;
+					rightBound = Game.Platforms[i].x - this.width / 2 + Game.Platforms[i].width / 2;
+				}
+			}
+			
+			if (this.x == this.lastPosition.x) heading = !heading;
+			else if (this.x >= this.rightBound) heading = false;
+			else if (this.x <= this.leftBound) heading = true;
+			
+			this.lastPosition.x = this.x;
+			
+			if (heading) this.x += 1 + speed;  else x -= 1 + speed;
+		}
+		
+	}
+
+}

src/ifrit/Fireball.as

 	public class Fireball extends Sprite
 	{		
 		public var fireball:Bitmap = Library.IMG("shuriken.png");
-		public var fireballC:Sprite = new Sprite();
+		protected var fireballC:Sprite = new Sprite();
 		
 		private var dx:int;
 		
-		public function Fireball(direction:int, x:Number, y:Number) 
+		public var friendly:Boolean;
+		
+		public function Fireball(direction:int, x:Number, y:Number, friendly:Boolean = true) 
 		{
 			addChild(fireballC);
 			
 			this.x = x;
 			this.y = y;
 			
+			this.friendly = friendly;
+			
 			addEventListener(Event.ENTER_FRAME, enterFrame);
 		}
 		

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
-/*
- * 
- */

src/ifrit/Man.as

-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
-	}
-}
+package ifrit 
+{
+	import flash.display.Bitmap;
+	import flash.display.Sprite;
+	import flash.events.Event;
+	import flash.geom.Point;
+	import flash.utils.Timer;
+	
+	/**
+	 * @author Chris Logsdon
+	 * @author Jake Albano
+	 */
+	
+	public class Mob extends Sprite
+	{
+		//	Graphical representation
+		public var bitmap:Bitmap;
+		protected var container:Sprite = new Sprite;
+		
+		private var shootTimer:Timer = new Timer(0, 20);
+		
+		//	Physics
+		public var gravUp:Boolean;
+		public var jumping:Boolean;
+		public var jumpTimer:Timer = new Timer(0, 2);
+		protected var velocity:Point = new Point(0, 0);
+		protected var speedLimit:Number;
+		
+		protected var halfSize:Point;
+		
+		public var friendly:Boolean;
+		
+		public function Mob(x:Number, y:Number, bitmap:Bitmap) 
+		{
+			this.bitmap = bitmap;
+			
+			addChild(container);
+			
+			container.x = bitmap.x - (bitmap.width / 2); // Set registration point to center
+			container.y = bitmap.y - (bitmap.height / 2);
+			bitmap.smoothing = true;
+			container.addChild(bitmap);
+			
+			this.x = x;
+			this.y = y;
+			
+			this.halfSize = new Point(this.width / 2, this.height / 2);
+			
+			speedLimit = 7;
+			
+			addEventListener(Event.ENTER_FRAME, onEnterFrame);
+		}
+		
+		/**
+		 * Override this to add AI
+		 */
+		public function think():void
+		{
+			
+		}
+		
+		public function jumpReset():void
+		{
+			velocity.y = 0;
+		}
+		
+		public function shoot():void
+		{
+			if (shootTimer.currentCount == shootTimer.repeatCount) {  shootTimer.reset();  }
+			
+			if (!shootTimer.running)
+			{
+				if (this.rotationY == 180) stage.addChild(new Fireball(-10, this.x, this.y));
+				else stage.addChild(new Fireball(10, this.x, this.y));
+				
+				Game.Projectiles.push(stage.getChildAt(stage.numChildren - 1));
+			}
+			
+			shootTimer.start();
+		}
+		
+		public function destroy():void
+		{
+			removeEventListener(Event.ENTER_FRAME, onEnterFrame);
+		}
+		
+		private function onEnterFrame(e:Event):void
+		{
+			think();
+			
+			if (gravUp)	velocity.y += Rules.gravity;
+			else velocity.y = 0;
+			
+			// Jump(rise) until spacebar up or until timer ends.
+			if (jumping && jumpTimer.currentCount < jumpTimer.repeatCount)
+			{
+				if (!jumpTimer.running)
+					jumpTimer.start();
+				
+				velocity.y += -5;
+				
+				if (velocity.x >= speedLimit) {	velocity.x = speedLimit; }
+				if (velocity.x < -speedLimit) {	velocity.x = -speedLimit; }
+				if (velocity.y >= speedLimit) {	velocity.y = speedLimit; }
+				if (velocity.y < -speedLimit) {	velocity.y = -speedLimit; }
+				
+			}
+			
+			if (jumpTimer.currentCount == jumpTimer.repeatCount)
+				jumpTimer.stop();
+			
+			// Apply physics to player movement
+			this.x += velocity.x;
+			this.y += velocity.y;
+			
+			// Wrap mob position to stay in the stage
+			if (this.x + this.halfSize.x > stage.stageWidth) {  this.x = stage.stageWidth - this.halfSize.x;  }
+			
+			if (this.x - this.halfSize.x < 0) {  this.x = 0 + this.halfSize.x;  }
+			
+			if (this.y + this.halfSize.y > stage.stageHeight)
+			{
+				velocity.x = 0;
+				velocity.y = 0;
+				this.y = stage.stageHeight - this.halfSize.y;
+				
+				jumpTimer.reset(); // Reset when on floor, to avoid constant jumping in air
+			}
+			
+			if (this.y - this.halfSize.y < 0)
+			{
+				velocity.x = 0;
+				velocity.y = 0;
+				this.y = 0 + this.halfSize.y;
+			}
+			
+			gravUp = true;
+		}
+		
+	}
+
+}

src/ifrit/Platform.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 Platform extends Sprite
+	{		
+		public var hWall:Bitmap = Library.IMG("horizontal.png");
+		public var hWallC:Sprite = new Sprite();
+		
+		public function Platform(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);
+		}
+		
+		public function collide(obj:DisplayObject):Boolean 
+		{
+			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;
+						
+						if (obj is Mob)
+						{
+							(obj as Mob).gravUp = false;
+							(obj as Mob).jumpTimer.reset();
+						}
+						
+					}
+					else if (obj.y >= this.y) // bottom
+					{
+						obj.y += oy;
+						if (obj is Mob)	(obj as Mob).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;
+						if (obj is Mob)
+						{
+							(obj as Mob).gravUp = false;
+							(obj as Mob).jumpTimer.reset();
+						}
+					}
+					else if (obj.y >= this.y) // bottom
+					{
+						obj.y += oy;
+						if (obj is Mob)	(obj as Mob).jumpReset();
+					}
+				}
+				
+				return true;
+			}
+			
+			return false;
+		}
+	}
+}
+
+//BUG: Strange results if player touching >1 platform at a time
+/*
+ * 
+ */

src/ifrit/Player.as

+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
+	 * @author Jake Albano
+	 */
+	public class Player extends Mob
+	{		
+		public function Player(x:Number, y:Number) 
+		{
+			super( x, y, Library.IMG("rogue.png") );
+			this.friendly = true;
+		}
+	}
+}

src/ifrit/Rules.as

+package ifrit 
+{
+	/**
+	 * ...
+	 * @author ...
+	 */
+	public final class Rules 
+	{
+		public static const gravity:Number = 1;
+		
+		public function Rules() {}
+		
+	}
+
+}

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);
-		}
-		
-	}
-
-}