[Super-tux-commit] supertux/src/badguy badguy.h,1.7,1.8 stalactite.h,1.1,1.2
Brought to you by:
wkendrick
From: Matze B. <mat...@us...> - 2005-04-03 21:22:16
|
Update of /cvsroot/super-tux/supertux/src/badguy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22652/src/badguy Modified Files: badguy.h stalactite.h Log Message: had more changes lying around here Index: stalactite.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/stalactite.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- stalactite.h 1 Apr 2005 12:16:52 -0000 1.1 +++ stalactite.h 3 Apr 2005 21:22:04 -0000 1.2 @@ -18,7 +18,6 @@ void deactivate(); private: - Physic physic; Timer2 timer; enum StalactiteState { Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/badguy.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- badguy.h 25 Mar 2005 20:39:54 -0000 1.7 +++ badguy.h 3 Apr 2005 21:22:04 -0000 1.8 @@ -27,13 +27,24 @@ BadGuy(); ~BadGuy(); - //virtual void action_activated(float elapsed_time); - + /** Called when the badguy is drawn. The default implementation simply draws + * the badguy sprite on screen + */ virtual void draw(DrawingContext& context); + /** Called each frame. The default implementation checks badguy state and + * calls active_action and inactive_action + */ virtual void action(float elapsed_time); + /** Called when a collision with another object occured. The default + * implemetnation calls collision_player, collision_solid, collision_badguy + * and collision_squished + */ virtual HitResponse collision(GameObject& other, const CollisionHit& hit); + /** Set the badguy to kill/falling state, which makes him falling of the + * screen (his sprite is turned upside-down) + */ virtual void kill_fall(); Vector get_start_position() const @@ -53,17 +64,25 @@ STATE_SQUISHED, STATE_FALLING }; - + + /** Called when the badguy collided with a player */ virtual HitResponse collision_player(Player& player, const CollisionHit& hit); + /** Called when the badguy collided with solid ground */ virtual HitResponse collision_solid(GameObject& other, const CollisionHit& hit); + /** Called when the badguy collided with another badguy */ virtual HitResponse collision_badguy(BadGuy& other, const CollisionHit& hit); - + + /** Called when the player hit the badguy from above. You should return true + * if the badguy was squished, false if squishing wasn't possible + */ virtual bool collision_squished(Player& player); + /** called each frame when the badguy is activated. */ virtual void active_action(float elapsed_time); + /** called each frame when the badguy is not activated. */ virtual void inactive_action(float elapsed_time); /** |