From f04a9e2da0f536ef0bf8fee7347fec9d48ea5d93 Mon Sep 17 00:00:00 2001 From: Marek Moeckel Date: Mon, 7 Jun 2004 19:52:46 +0000 Subject: [PATCH] Dust clouds are now drawn around Tux' feet whenever he does a butt stomp. Someone please improve the sprite! :-) SVN-Revision: 1422 --- data/images/shared/stomp.png | Bin 0 -> 2579 bytes data/supertux.strf | 9 ++++++++- src/player.cpp | 9 +++++++++ src/player.h | 2 ++ src/resources.cpp | 4 ++++ 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 data/images/shared/stomp.png diff --git a/data/images/shared/stomp.png b/data/images/shared/stomp.png new file mode 100644 index 0000000000000000000000000000000000000000..3a03857bc5c4f555eb323fbb353ea78e19c6408c GIT binary patch literal 2579 zcmZWreK^zW8~<{4+CsIJYRRuyh|KYtlXuN`F)ztm*-qqO4((uToXNa~e39g(#ppP{ zxsYibE6%Z+mxzic#ESA#ISVn7*D=4Hzkk+^Z;>%N~m>)cuAT`C$X z008VFxPaaYAEYoX#16$i*Out3a65wCoIzmw-}Q&Ex=?}aq`DC40HC_>UsD3uWoQKm zk0E&A;jeeV_ZjcE^jI@iK>vxs`^Pv%M@EvPVgRQr6q|usjOjDUI1w( zu1#j9Q`eE+&D0PT6eY8aw2Vy{aS$JT`iet zf4G}wUE=;O+`{_2tMC$Q%0?Szqmg@29LtD)FNh7lu|6Xbi6ogFlRAA%UFaqAkls~3 zR#vS;nDOK+M2?2V25dJpuHY$i5-!*EV9wL&%Z>5lBw5g&`~?hpjRL{{$AK1F1Mu3{U~ zY-{h*=B2Zqo}N+f{?;y)e14f%`eSrp#OTW5o~gx>_MnAOKR+9hRTjquhtR^9nBQ;o zRmWfE`8hi~D>yzhywuqW&tAW;AtAQ1Kndd7gBCF43T0CHD@Wsdg=c$=vC zl|}CAm|<8|i?q;&F>h* zJ@$B=(PuCFVtiDCDqERzFzwppt;%1a(*$(}guOSqL(-AYNV9i(baT%fgAftCd`Yuu zR~s{r%eCxRl4$ajfW7%otX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7&f z==Cj8IwnnwvV(ofbki3U4WLCn#*}V7XdD)<|5Lh1IF%i@K6U3gx}rROrpCB3Vq>*; zGlF*#g?hp73~mVLas`UvASsDT1wwjnw@4j^nv8~Gg)=g_B(1&8pi=G#o|)C?NA)v% mH-GdP+#IF%*-4ZpT9q#EdCjLy`DiO literal 0 HcmV?d00001 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: */ -- 2.11.0