X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fstumpy.cpp;h=2cac026a1665956aa582195508c35b2a2ebc6a4a;hb=013a5ca196545a094f27c1b708facd0084d58d55;hp=7654292c2fa32da3f161c4edd4f5239526228ba6;hpb=714a30abd887def6331a193216387e66cbfbd1bb;p=supertux.git diff --git a/src/badguy/stumpy.cpp b/src/badguy/stumpy.cpp index 7654292c2..2cac026a1 100644 --- a/src/badguy/stumpy.cpp +++ b/src/badguy/stumpy.cpp @@ -1,4 +1,4 @@ -// $Id: stumpy.cpp 3980 2006-07-10 19:55:56Z sommer $ +// $Id$ // // SuperTux // Copyright (C) 2006 Matthias Braun @@ -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;