hyppy vinoon
authorekku
Mon, 01 Dec 2008 17:23:28 +0000
changeset 159 109c7612ae2d
parent 158 0215ace86018
child 160 ba0b6f421a3c
hyppy vinoon
src/proto2/Physics.cc
src/proto2/Terrain.cc
--- a/src/proto2/Physics.cc	Mon Dec 01 15:33:49 2008 +0000
+++ b/src/proto2/Physics.cc	Mon Dec 01 17:23:28 2008 +0000
@@ -110,8 +110,9 @@
 void PhysicsObject::jump () {
     // Jump only if player is "on the ground"
     if (!this->inAir) {
- 	velocity.y = -100;
-	inAir = true;
+ 	    velocity.y = -100;
+        velocity.x += facingRight ? 20 : -20;
+	    inAir = true;
     }
 }
 
--- a/src/proto2/Terrain.cc	Mon Dec 01 15:33:49 2008 +0000
+++ b/src/proto2/Terrain.cc	Mon Dec 01 17:23:28 2008 +0000
@@ -255,8 +255,9 @@
              x < std::min((int32_t)MAP_WIDTH, midx+range); 
              x++) {
             for (int y = std::max(0, midy-range);
-                 y < std::min((int32_t)MAP_HEIGHT, midy+range);
-                 y++) {
+                    y < std::min((int32_t)MAP_HEIGHT, midy+range);
+                    y++) {
+                
                 terrain[x][y] = type;
             }