Commits

Chris Logsdon committed 4053478

Re-fixed mid-air jumping bug;
Re-moved speedLimit checks out of jumping if statement;
Changed collision detection between projectiles and enemies to hitTestObject;

Comments (0)

Files changed (4)

obj/IfritConfig.old

     </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>
+      <path-element>C:\Dev\Flash Projects\ifrit\src</path-element>
+      <path-element>C:\Program Files\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>
+    <path-element>C:\Dev\Flash Projects\ifrit\src\Game.as</path-element>
   </file-specs>
   <default-background-color>#FFFFFF</default-background-color>
   <default-frame-rate>30</default-frame-rate>

obj/IfritConfig.xml

     </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>
+      <path-element>C:\Dev\Flash Projects\ifrit\src</path-element>
+      <path-element>C:\Program Files\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>
+    <path-element>C:\Dev\Flash Projects\ifrit\src\Game.as</path-element>
   </file-specs>
   <default-background-color>#FFFFFF</default-background-color>
   <default-frame-rate>30</default-frame-rate>
 					{						
 						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].hitTestObject(Mobs[l]))
 							{
 								if (Projectiles[k].friendly != Mobs[l].friendly)
 								{
 			else velocity.y = 0;
 			
 			// Jump(rise) until spacebar up or until timer ends.
-			if (jumping && jumpTimer.currentCount < jumpTimer.repeatCount)
+			if (jumping && jumpTimer.currentCount < jumpTimer.repeatCount && velocity.y <=1)
 			{
 				if (!jumpTimer.running)
 					jumpTimer.start();
 				
 				velocity.y += -5;
 				
-				if (velocity.x >= speedLimit.x) {	velocity.x = speedLimit.x; }
-				if (velocity.x < -speedLimit.x) {	velocity.x = -speedLimit.x; }
-				if (velocity.y >= speedLimit.y) {	velocity.y = speedLimit.y; }
-				if (velocity.y < -speedLimit.x) {	velocity.y = -speedLimit.x; }
-				
 			}
 			
 			if (jumpTimer.currentCount == jumpTimer.repeatCount)
 				jumpTimer.stop();
-			
+				
+			if (velocity.x >= speedLimit.x) { velocity.x = speedLimit.x; }
+			if (velocity.x < -speedLimit.x) { velocity.x = -speedLimit.x; }
+			if (velocity.y >= speedLimit.y) { velocity.y = speedLimit.y; }
+			if (velocity.y < -speedLimit.x) { velocity.y = -speedLimit.x; }
+				
 			// Apply physics to player movement
 			this.x += velocity.x;
 			this.y += velocity.y;