[Super-tux-commit] supertux/src physic.cpp,1.7,1.8 physic.h,1.9,1.10
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-04-17 15:22:02
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18703/src Modified Files: physic.cpp physic.h Log Message: Added inverse functions for speed. Might be usefull for someone that wants to make enemies to change directions when colliding with each other. Index: physic.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/physic.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- physic.h 11 Apr 2004 15:28:26 -0000 1.9 +++ physic.h 17 Apr 2004 15:21:50 -0000 1.10 @@ -28,6 +28,10 @@ /** sets velocity to a fixed value */ void set_velocity(float vx, float vy); + /** velocities invertion */ + void inverse_velocity_x(); + void inverse_velocity_y(); + float get_velocity_x(); float get_velocity_y(); Index: physic.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/physic.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- physic.cpp 11 Apr 2004 15:28:26 -0000 1.7 +++ physic.cpp 17 Apr 2004 15:21:50 -0000 1.8 @@ -41,6 +41,16 @@ vy = -nvy; } +void Physic::inverse_velocity_x() +{ +vx = -vx; +} + +void Physic::inverse_velocity_y() +{ +vy = -vy; +} + float Physic::get_velocity_x() { |