From: Marek Moeckel Date: Mon, 7 Jun 2004 19:52:46 +0000 (+0000) Subject: Dust clouds are now drawn around Tux' feet whenever he does a butt stomp. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f04a9e2da0f536ef0bf8fee7347fec9d48ea5d93;p=supertux.git Dust clouds are now drawn around Tux' feet whenever he does a butt stomp. Someone please improve the sprite! :-) SVN-Revision: 1422 --- diff --git a/data/images/shared/stomp.png b/data/images/shared/stomp.png new file mode 100644 index 000000000..3a03857bc Binary files /dev/null and b/data/images/shared/stomp.png differ diff --git a/data/supertux.strf b/data/supertux.strf index f3136e7a7..8f92419c8 100644 --- a/data/supertux.strf +++ b/data/supertux.strf @@ -684,10 +684,17 @@ ; Door (sprite (name "door") - (y-hotspot 0) + (x-hotspot 0) (y-hotspot 0) (images "shared/door.png") ) + + ; Stomp + (sprite (name "stomp") + (x-hotspot 0) + (y-hotspot 0) + (images "shared/stomp.png") + ) ) ;; EOF ;; diff --git a/src/player.cpp b/src/player.cpp index 9366cd511..a049774fc 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -39,6 +39,7 @@ #define TILES_FOR_BUTTJUMP 3 // animation times (in ms): #define SHOOTING_TIME 320 +#define STOMP_TIME 250 // others stuff: #define AUTOSCROLL_DEAD_INTERVAL 300 @@ -507,6 +508,7 @@ Player::handle_vertical_input() // Do butt jump if (butt_jump && on_ground() && size == BIG) { + stomp_timer.start(STOMP_TIME); butt_jump = false; // Break bricks beneath Tux @@ -764,6 +766,13 @@ Player::draw(DrawingContext& context) else sprite->grab_left->draw(context, pos, LAYER_OBJECTS + 1); } + + // Draw stomp clouds when doing a butt jump + if (stomp_timer.check()) + if (duck) + sprite->stomp->draw(context, Vector(base.x - 32, base.y), LAYER_OBJECTS + 1); + else + sprite->stomp->draw(context, Vector(base.x - 32, base.y + 32), LAYER_OBJECTS + 1); // Draw blinking star overlay if (invincible_timer.started() && diff --git a/src/player.h b/src/player.h index e23c2063b..8c2e342c4 100644 --- a/src/player.h +++ b/src/player.h @@ -107,6 +107,7 @@ struct PlayerSprite Sprite* grab_right; Sprite* duck_right; Sprite* duck_left; + Sprite* stomp; }; extern PlayerSprite smalltux; @@ -150,6 +151,7 @@ public: Timer shooting_timer; // used to show the arm when Tux is shooting Timer dying_timer; Timer growing_timer; + Timer stomp_timer; Physic physic; public: diff --git a/src/resources.cpp b/src/resources.cpp index d9a229d86..d8fe66720 100644 --- a/src/resources.cpp +++ b/src/resources.cpp @@ -78,6 +78,7 @@ void loadshared() smalltux.skid_right = sprite_manager->load("smalltux-skid-right"); smalltux.grab_left = sprite_manager->load("smalltux-grab-left"); smalltux.grab_right = sprite_manager->load("smalltux-grab-right"); + smalltux.stomp = sprite_manager->load("stomp"); largetux.stand_left = sprite_manager->load("largetux-stand-left"); largetux.stand_right = sprite_manager->load("largetux-stand-right"); @@ -93,6 +94,7 @@ void loadshared() largetux.grab_right = sprite_manager->load("largetux-grab-right"); largetux.duck_left = sprite_manager->load("largetux-duck-left"); largetux.duck_right = sprite_manager->load("largetux-duck-right"); + largetux.stomp = sprite_manager->load("stomp"); firetux.stand_left = sprite_manager->load("firetux-stand-left"); firetux.stand_right = sprite_manager->load("firetux-stand-right"); @@ -108,6 +110,7 @@ void loadshared() firetux.grab_right = sprite_manager->load("firetux-grab-right"); firetux.duck_left = sprite_manager->load("firetux-duck-left"); firetux.duck_right = sprite_manager->load("firetux-duck-right"); + firetux.stomp = sprite_manager->load("stomp"); icetux.stand_left = sprite_manager->load("icetux-stand-left"); icetux.stand_right = sprite_manager->load("icetux-stand-right"); @@ -123,6 +126,7 @@ void loadshared() icetux.grab_right = sprite_manager->load("icetux-grab-right"); icetux.duck_left = sprite_manager->load("icetux-duck-left"); icetux.duck_right = sprite_manager->load("icetux-duck-right"); + icetux.stomp = sprite_manager->load("stomp"); /* Water: */