# HG changeset patch # User ekku # Date 1228410427 0 # Node ID 36048d3250d09b4686773c4603c4630ea57f68e0 # Parent 0c8f0547a4230d4ab44dcbb8e85fc0e8d004deff vauhtivakiot isommiksi, walk kuntoon diff -r 0c8f0547a423 -r 36048d3250d0 src/Config.hh --- a/src/Config.hh Thu Dec 04 16:58:05 2008 +0000 +++ b/src/Config.hh Thu Dec 04 17:07:07 2008 +0000 @@ -31,8 +31,8 @@ const float PLAYER_INITIAL_Y = 300.0; const float CROSSHAIR_ANGLE_SPEED = PI/40; -const float PLAYER_MAX_SPEED = 70; -const float PLAYER_WALK_SPEED = 65; +const float PLAYER_MAX_SPEED = 130; +const float PLAYER_WALK_SPEED = 130; const float PLAYER_COLLISION_ELASTICITY = 0.3; // TODO: This could be // different for different diff -r 0c8f0547a423 -r 36048d3250d0 src/Physics.cc --- a/src/Physics.cc Thu Dec 04 16:58:05 2008 +0000 +++ b/src/Physics.cc Thu Dec 04 17:07:07 2008 +0000 @@ -110,17 +110,15 @@ // And we return where we got return reached; } -Vector PhysicsObject::walk (TimeMS dt, bool right) { +void PhysicsObject::walk (TimeMS dt, bool right) { float velocity = PLAYER_WALK_SPEED; float walkAmount = (velocity*dt)/1000; Vector reached = this->position; while(walkAmount > 0 && !this->inAir) { - reached = walk_one_step((1 < walkAmount ? 1 : walkAmount), right); + this->position = walk_one_step((1 < walkAmount ? 1 : walkAmount), right); walkAmount--; - this->position = reached; } // TODO: Should the remaining walkAmount be handled somehow? - return reached; } /** @@ -206,7 +204,7 @@ // It walks only if there's some vertical force if (total.x != 0) { std::cout << "Succeeding to walk" << std::endl; - this->position = walk(PHYSICS_TICK_MS, total.x > 0); + walk(PHYSICS_TICK_MS, total.x > 0); this->velocity = Vector(0,0); } } diff -r 0c8f0547a423 -r 36048d3250d0 src/Physics.hh --- a/src/Physics.hh Thu Dec 04 16:58:05 2008 +0000 +++ b/src/Physics.hh Thu Dec 04 17:07:07 2008 +0000 @@ -201,7 +201,7 @@ * @param right Boolean describing the movement direction. * @return New position */ - Vector walk(TimeMS, bool right); + void walk(TimeMS, bool right); Vector walk_one_step(float, bool); /*