Rolled back bomb to old behaviour, some bomb gfx tuning
[supertux.git] / src / badguy / stumpy.cpp
index 7654292..2cac026 100644 (file)
@@ -1,4 +1,4 @@
-//  $Id: stumpy.cpp 3980 2006-07-10 19:55:56Z sommer $
+//  $Id$
 //
 //  SuperTux
 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
@@ -32,7 +32,6 @@ Stumpy::Stumpy(const lisp::Lisp& reader)
 {
   walk_speed = WALKSPEED;
   max_drop_height = 16;
-  sound_manager->preload("sounds/mr_tree.ogg");
   sound_manager->preload("sounds/mr_treehit.ogg");
 }
 
@@ -55,16 +54,16 @@ Stumpy::write(lisp::Writer& writer)
 }
 
 void
-Stumpy::activate()
+Stumpy::initialize()
 {
   switch (mystate) {
     case STATE_INVINCIBLE:
       sprite->set_action(dir == LEFT ? "dizzy-left" : "dizzy-right");
       bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
-      physic.vx = 0;
+      physic.set_velocity_x(0);
       break;
     case STATE_NORMAL:
-      WalkingBadguy::activate();
+      WalkingBadguy::initialize();
       break;
   }
 }
@@ -76,7 +75,7 @@ Stumpy::active_update(float elapsed_time)
     case STATE_INVINCIBLE:
       if (invincible_timer.check()) {
        mystate = STATE_NORMAL;
-        WalkingBadguy::activate();
+        WalkingBadguy::initialize();
       }
       BadGuy::active_update(elapsed_time);
       break;
@@ -132,10 +131,10 @@ Stumpy::collision_solid(const CollisionHit& hit)
   switch (mystate) {
     case STATE_INVINCIBLE:
       if(hit.top || hit.bottom) {
-        physic.vy = 0;
+        physic.set_velocity_y(0);
       }
       if(hit.left || hit.right) {
-        physic.vx = 0;
+        physic.set_velocity_x(0);
       }
       break;
     case STATE_NORMAL:
@@ -150,10 +149,10 @@ Stumpy::collision_badguy(BadGuy& badguy, const CollisionHit& hit)
   switch (mystate) {
     case STATE_INVINCIBLE:
       if(hit.top || hit.bottom) {
-       physic.vy = 0;
+       physic.set_velocity_y(0);
       }
       if(hit.left || hit.right) {
-       physic.vx = 0;
+       physic.set_velocity_x(0);
       }
       return CONTINUE;
       break;