X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fzeekling.cpp;h=ffea907c013c67c9ec77d9c9cd8ad6d1bd5f6cc8;hb=013a5ca196545a094f27c1b708facd0084d58d55;hp=64a45669e36079b8e07b8893f43b75e8bcfa23b6;hpb=3655d32f63f75b2af054ec68d4176e55a561ba96;p=supertux.git diff --git a/src/badguy/zeekling.cpp b/src/badguy/zeekling.cpp index 64a45669e..ffea907c0 100644 --- a/src/badguy/zeekling.cpp +++ b/src/badguy/zeekling.cpp @@ -2,7 +2,7 @@ // // Zeekling - flyer that swoops down when she spots the player // Copyright (C) 2005 Matthias Braun -// Copyright (C) 2006 Christoph Sommer +// Copyright (C) 2006 Christoph Sommer // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -29,12 +29,16 @@ Zeekling::Zeekling(const lisp::Lisp& reader) : BadGuy(reader, "images/creatures/zeekling/zeekling.sprite"), last_player(0) { state = FLYING; + speed = systemRandom.rand(130, 171); + physic.enable_gravity(false); } Zeekling::Zeekling(const Vector& pos, Direction d) : BadGuy(pos, d, "images/creatures/zeekling/zeekling.sprite"), last_player(0) { state = FLYING; + speed = systemRandom.rand(130, 171); + physic.enable_gravity(false); } void @@ -49,11 +53,9 @@ Zeekling::write(lisp::Writer& writer) } void -Zeekling::activate() +Zeekling::initialize() { - speed = systemRandom.rand(130, 171); physic.set_velocity_x(dir == LEFT ? -speed : speed); - physic.enable_gravity(false); sprite->set_action(dir == LEFT ? "left" : "right"); }