Commits

Jake Albano committed fddb9a9

Fixed bug where player could move through boundaries and platforms while the level was loading;
Fixed music restarting when the first level in a set was loaded;

  • Participants
  • Parent commits 815069e

Comments (0)

Files changed (4)

obj/IfritConfig.xml

     </define>
     <define append="true">
       <name>CONFIG::timeStamp</name>
-      <value>'8/1/2012'</value>
+      <value>'9/25/2012'</value>
     </define>
     <verbose-stacktraces>true</verbose-stacktraces>
     <source-path append="true">
 				}
 			}
 			
-			if (man && !man.isDestroyed)
+			if (man && !man.isDestroyed && !World.loading)
 			{	
 				if (checkLadder())
 				{

src/ifrit/World.as

 		public static var currentLevel:String;
 		public static var hasKey:Boolean;
 		public static var audio:Audio;
+		public static var loading:Boolean;
 		
 		/**
 		 * Initialize the world manager
 			World.Mobs 			= new Vector.<Mob>;
 			World.Ladders 		= new Vector.<Ladder>;
 			
+			loading = false;
+			
 			//	Using my custom map class to store levels
 			//	It works the same way as a C++ (STL) map, storing objects with keys
 			Worlds = new Map(String, Function);
 		
 		private static function loadForest_01():void
 		{
-			audio.stopAll();
+			if (nextLevel != "forest_02")
+			{
+				audio.stopAll();
+			}
+			
 			audio.playMusic("forest", 3);
 			
 			WorldUtils.makeBounds();
 		
 		private static function loadTower_01():void
 		{
-			audio.stopAll();
+			if (nextLevel != "tower_02")
+			{
+				audio.stopAll();
+			}
+			
 			audio.playMusic("tower", 3);
 			
 			WorldUtils.makeBounds();
 		
 		private static function loadDungeon_01():void 
 		{
-			audio.stopAll();
+			if (nextLevel != "dungeon_02")
+			{
+				audio.stopAll();
+			}
+			
 			audio.playMusic("dungeon", 3);
 			
 			WorldUtils.makeBounds();
 			
 			WorldUtils.addWall( 250, 100, false, Library.getImage("dungeon.platform.png"), 100);
 			
-			WorldUtils.addWall( 300, 285, false, Library.getImage("dungeon.platform.png"), 75);
-			WorldUtils.addWall(267.5, 285, true, Library.getImage("misc.clipPlatform.png"), 5);
+			WorldUtils.addWall( 300, 290, false, Library.getImage("dungeon.platform.png"), 75);
+			WorldUtils.addWall(267.5, 290, true, Library.getImage("misc.clipPlatform.png"), 5);
 			
 			WorldUtils.addWall( 300, 220, false, Library.getImage("dungeon.platform.png"), 75);
 			
 		
 		private static function loadHellther_01():void
 		{
-			audio.stopAll();
+			if (nextLevel != "hellther_02")
+			{
+				audio.stopAll();
+			}
+			
 			audio.playMusic("hellther", 3);
 			
 			WorldUtils.makeBounds();

src/ifrit/WorldUtils.as

 			World.currentLevel = name;
 			SaveState.level = name;
 			
+			World.loading = true;
 			addDecal(new Bitmap(new BitmapData(1000, 500, true, 0xff000000)), 500, 250, fade );
 			
 		}
 		 */
 		public static function fade(d:Decal):void
 		{
+			World.loading = false;
 			if (d.alpha > 0) 	d.alpha -= 0.025;
-			if (d.alpha <= 0)	Game.stage.removeChild(d);
+			if (d.alpha <= 0)
+			{
+				Game.stage.removeChild(d);
+			}
 		}
 		
 		public static function slowFade(d:Decal):void