Dust clouds are now drawn around Tux' feet whenever he does a butt stomp.
authorMarek Moeckel <wansti@gmx.de>
Mon, 7 Jun 2004 19:52:46 +0000 (19:52 +0000)
committerMarek Moeckel <wansti@gmx.de>
Mon, 7 Jun 2004 19:52:46 +0000 (19:52 +0000)
Someone please improve the sprite! :-)

SVN-Revision: 1422

data/images/shared/stomp.png [new file with mode: 0644]
data/supertux.strf
src/player.cpp
src/player.h
src/resources.cpp

diff --git a/data/images/shared/stomp.png b/data/images/shared/stomp.png
new file mode 100644 (file)
index 0000000..3a03857
Binary files /dev/null and b/data/images/shared/stomp.png differ
index f3136e7..8f92419 100644 (file)
 
   ; 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 ;;
index 9366cd5..a049774 100644 (file)
@@ -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() &&
index e23c206..8c2e342 100644 (file)
@@ -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:
index d9a229d..d8fe667 100644 (file)
@@ -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: */