Made statistics to keep track of also: bad guys squished, shots, time needed and...
[supertux.git] / src / player.cpp
index 5fec558..f5bfcda 100644 (file)
@@ -35,6 +35,7 @@
 #include "resources.h"
 #include "interactive_object.h"
 #include "video/screen.h"
+#include "statistics.h"
 
 // behavior definitions:
 #define TILES_FOR_BUTTJUMP 3
@@ -517,6 +518,8 @@ Player::handle_vertical_input()
   // Press jump key
   if(input.up == DOWN && can_jump && on_ground())
     {
+      global_stats.add_points(JUMPS_STAT, 1);
+
       if(duck) { // only jump a little bit when in duck mode {
         physic.set_velocity_y(3);
       } else {
@@ -870,7 +873,8 @@ Player::draw(DrawingContext& context)
 
   // Draw blinking star overlay
   if (invincible_timer.started() &&
-     (invincible_timer.get_left() > TUX_INVINCIBLE_TIME_WARNING || global_frame_counter % 3))
+     (invincible_timer.get_left() > TUX_INVINCIBLE_TIME_WARNING || global_frame_counter % 3)
+     && !dying)
   {
     if (size == SMALL || duck)
       smalltux_star->draw(context, pos, LAYER_OBJECTS + 2);