about summary refs log tree commit diff
path: root/src/game/g_game.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-04-06 14:32:56 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-04-06 14:32:56 +0000
commit6ecc2efaecdf70ed6a754bc089c7e0e4606df398 (patch)
treede81f3402de0c924acf10c2f71e4dbc721444890 /src/game/g_game.cpp
parentd15bef7ede6b07dbbc2f6b6a3e23b1ed83e6b6ea (diff)
downloadzcatch-6ecc2efaecdf70ed6a754bc089c7e0e4606df398.tar.gz
zcatch-6ecc2efaecdf70ed6a754bc089c7e0e4606df398.zip
more loads of changes for 0.5.0
Diffstat (limited to 'src/game/g_game.cpp')
-rw-r--r--src/game/g_game.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/g_game.cpp b/src/game/g_game.cpp
index 747b832a..71ddc1a2 100644
--- a/src/game/g_game.cpp
+++ b/src/game/g_game.cpp
@@ -199,12 +199,12 @@ void player_core::tick()
 	float friction = grounded ? world->tuning.ground_friction : world->tuning.air_friction;
 	
 	// handle movement
-	if(input.left)
+	if(input.direction < 0)
 		vel.x = saturated_add(-max_speed, max_speed, vel.x, -accel);
-	if(input.right)
+	if(input.direction > 0)
 		vel.x = saturated_add(-max_speed, max_speed, vel.x, accel);
 		
-	if(!input.left && !input.right)
+	if(input.direction == 0)
 		vel.x *= friction;
 	
 	// handle jumping
@@ -339,7 +339,7 @@ void player_core::tick()
 			
 			// the hook will boost it's power if the player wants to move
 			// in that direction. otherwise it will dampen everything abit
-			if((hookvel.x < 0 && input.left) || (hookvel.x > 0 && input.right)) 
+			if((hookvel.x < 0 && input.direction < 0) || (hookvel.x > 0 && input.direction > 0)) 
 				hookvel.x *= 0.95f;
 			else
 				hookvel.x *= 0.75f;