[Super-tux-commit] supertux/src defines.h,1.17,1.18 globals.cpp,1.16,1.17 physic.cpp,1.9,1.10 physic
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-04-20 17:32:26
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12665 Modified Files: defines.h globals.cpp physic.cpp physic.h player.cpp Log Message: - switched gamespeed back to normal - added high-jump while running Index: physic.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/physic.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- physic.h 20 Apr 2004 11:09:34 -0000 1.11 +++ physic.h 20 Apr 2004 17:31:11 -0000 1.12 @@ -36,6 +36,9 @@ /** sets velocity to a fixed value */ void set_velocity(float vx, float vy); + void set_velocity_x(float vx); + void set_velocity_y(float vy); + /** velocities invertion */ void inverse_velocity_x(); void inverse_velocity_y(); Index: physic.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/physic.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- physic.cpp 20 Apr 2004 11:09:34 -0000 1.9 +++ physic.cpp 20 Apr 2004 17:31:11 -0000 1.10 @@ -44,6 +44,18 @@ } void +Physic::set_velocity_x(float nvx) +{ + vx = -nvx; +} + +void +Physic::set_velocity_y(float nvy) +{ + vy = -nvy; +} + +void Physic::set_velocity(float nvx, float nvy) { vx = nvx; Index: globals.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/globals.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- globals.cpp 20 Apr 2004 16:50:18 -0000 1.16 +++ globals.cpp 20 Apr 2004 17:31:11 -0000 1.17 @@ -54,7 +54,7 @@ bool use_fullscreen; bool debug_mode; bool show_fps; -float game_speed = 1.2f; +float game_speed = 1.0f; int joystick_num = 0; char* level_startup_file = 0; Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- player.cpp 20 Apr 2004 16:25:57 -0000 1.47 +++ player.cpp 20 Apr 2004 17:31:11 -0000 1.48 @@ -206,7 +206,7 @@ if(under_solid()) { // fall down - physic.set_velocity(physic.get_velocity_x(), 0); + physic.set_velocity_y(0); jumped_in_solid = true; } } @@ -216,7 +216,7 @@ if (physic.get_velocity_y() < 0) { base.y = (int)(((int)base.y / 32) * 32); - physic.set_velocity(physic.get_velocity_x(), 0); + physic.set_velocity_y(0); } physic.enable_gravity(false); @@ -410,7 +410,11 @@ if (on_ground()) { // jump - physic.set_velocity(physic.get_velocity_x(), 5.5); + if (physic.get_velocity_x() > MAX_WALK_XM) + physic.set_velocity_y(5.8); + else + physic.set_velocity_y(5.2); + --base.y; jumping = true; if (size == SMALL) @@ -423,7 +427,7 @@ { jumping = false; if(physic.get_velocity_y() > 0) { - physic.set_velocity(physic.get_velocity_x(), 0); + physic.set_velocity_y(0); } } } Index: defines.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/defines.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- defines.h 20 Apr 2004 12:24:28 -0000 1.17 +++ defines.h 20 Apr 2004 17:31:00 -0000 1.18 @@ -75,8 +75,8 @@ #define GRAVITY 1.0 #define YM_FOR_JUMP 6.0 -#define WALK_ACCELERATION_X 0.02 -#define RUN_ACCELERATION_X 0.03 +#define WALK_ACCELERATION_X 0.03 +#define RUN_ACCELERATION_X 0.04 #define KILL_BOUNCE_YM 8.0 #define SKID_XM 2.0 |