[Super-tux-commit] supertux/src/badguy badguy.h,1.6,1.7 mrtree.cpp,1.1,1.2
Brought to you by:
wkendrick
From: Matze B. <mat...@us...> - 2005-03-25 20:40:09
|
Update of /cvsroot/super-tux/supertux/src/badguy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9911/src/badguy Modified Files: badguy.h mrtree.cpp Log Message: Had a bit of time today and worked on supertux: - Commited some old changes I had lying around here (improved mrtree images? and improvement to the collision grid which still isn't enabled by default) - Did a bit more cleanups (eleminated defines.h and renamed scene.* to player_status.* as that is waht ti really contained) - Cleaned up PlayerStatus code a bit (refactored loading/saving out of worldmap into PlayerStatus) - Implemented LevelTransformer interface and did a first test with a flip level transformer - Removed explicit LevelEndSequence attribute (can be done by placing aprorpiate SequenceTrigger objects) Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/badguy.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- badguy.h 30 Dec 2004 11:29:52 -0000 1.6 +++ badguy.h 25 Mar 2005 20:39:54 -0000 1.7 @@ -11,6 +11,7 @@ #include "serializable.h" #include "resources.h" #include "sector.h" +#include "direction.h" #include "object_factory.h" #include "lisp/parser.h" #include "lisp/lisp.h" @@ -35,6 +36,15 @@ virtual void kill_fall(); + Vector get_start_position() const + { + return start_position; + } + void set_start_position(const Vector& vec) + { + start_position = vec; + } + protected: enum State { STATE_INIT, Index: mrtree.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/mrtree.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mrtree.cpp 30 Dec 2004 14:39:08 -0000 1.1 +++ mrtree.cpp 25 Mar 2005 20:39:54 -0000 1.2 @@ -3,6 +3,7 @@ #include "mrtree.h" static const float WALKSPEED = 50; +static const float WALKSPEED_SMALL = 30; MrTree::MrTree(const lisp::Lisp& reader) : mystate(STATE_BIG) @@ -27,11 +28,13 @@ void MrTree::activate() { - physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED); - if(mystate == STATE_BIG) + if(mystate == STATE_BIG) { + physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED); sprite->set_action(dir == LEFT ? "left" : "right"); - else + } else { + physic.set_velocity_x(dir == LEFT ? -WALKSPEED_SMALL : WALKSPEED_SMALL); sprite->set_action(dir == LEFT ? "small-left" : "small-right"); + } } bool |