From: Wolfgang Becker Date: Mon, 3 Jul 2006 12:13:12 +0000 (+0000) Subject: Support for initial direction "left"|"right"|"auto" in Dispenser, X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=12966e3f986f7202125ae590c74a4d0c227441dd;p=supertux.git Support for initial direction "left"|"right"|"auto" in Dispenser, DartTrap, Snail, Zeekling, PoisonIvy, MrTree, SleepingSpiky, Spiky, BouncingSnowball, MrIceBlock, SnowBall, MrBomb. SVN-Revision: 3849 --- diff --git a/data/levels/test/direction.stl b/data/levels/test/direction.stl new file mode 100644 index 000000000..5a70950e6 --- /dev/null +++ b/data/levels/test/direction.stl @@ -0,0 +1,189 @@ +(supertux-level + (version 2) + (name (_ "Unnamed")) + (author "wolfgang") + (sector + (name "main") + (background + (speed 0.5) + (image-top "images/background/arctis_top.jpg") + (image "images/background/arctis.jpg") + (image-bottom "images/background/arctis_bottom.jpg") + ) + (tilemap + (z-pos -100) + (solid #f) + (speed 1) + (width 50) + (height 35) + (tiles 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) + ) + (camera + (mode "normal") + ) + (mrbomb + (direction "left") + (x 300.336) + (y 495.7777) + ) + (mrbomb + (direction "auto") + (x 1047.041) + (y 501.4346) + ) + (mrbomb + (direction "left") + (x 569.0366) + (y 269.5035) + ) + (mrbomb + (direction "right") + (x 493.7288) + (y 268.332) + ) + (mrbomb + (direction "right") + (x 419.13) + (y 498.6062) + ) + (sspiky + (direction "left") + (x 240.939) + (y 787.1058) + ) + (sspiky + (direction "right") + (x 342.7624) + (y 781.4489) + ) + (sspiky + (direction "auto") + (x 911.2763) + (y 784.2773) + ) + (sspiky + (direction "auto") + (x 506.8112) + (y 787.1057) + ) + (spawnpoint + (name "main") + (x 768) + (y 96) + ) + (dispenser + (badguy "mrrocket") + (cycle 1) + (direction "left") + (x 215.4832) + (y 996.4092) + ) + (dispenser + (badguy "mrrocket") + (cycle 1) + (direction "right") + (x 472.8701) + (y 999.2377) + ) + (dispenser + (badguy "random") + (cycle 1) + (direction "auto") + (x 931.0753) + (y 917.2133) + ) + (dispenser + (badguy "random") + (cycle 1) + (direction "left") + (x 1240.788) + (y 912.9707) + ) + (dispenser + (badguy "random") + (cycle 1) + (direction "") + (x 1379.381) + (y 911.5566) + ) + (dispenser + (badguy "random") + (cycle 1) + (direction "right") + (x 1093.71) + (y 910.1423) + ) + (darttrap + (initial-delay 0) + (fire-delay 2) + (ammo -1) + (direction "right") + (x 256.5859) + (y 964.7768) + ) + (darttrap + (initial-delay 0) + (fire-delay 2) + (ammo -1) + (direction "auto") + (x 209.8263) + (y 890.3432) + ) + (darttrap + (initial-delay 0) + (fire-delay 2) + (ammo -1) + (direction "auto") + (x 258.0001) + (y 919.5219) + ) + (darttrap + (initial-delay 0) + (fire-delay 2) + (ammo -1) + (direction "left") + (x 259.4143) + (y 875.6813) + ) + (darttrap + (initial-delay 0) + (fire-delay 2) + (ammo -1) + (direction "left") + (x 498.4164) + (y 874.2671) + ) + (darttrap + (initial-delay 0) + (fire-delay 2) + (ammo -1) + (direction "auto") + (x 498.4164) + (y 919.5219) + ) + (darttrap + (initial-delay 0) + (fire-delay 2) + (ammo -1) + (direction "right") + (x 498.4164) + (y 961.9484) + ) + ) +) diff --git a/data/levels/world2/fish.stl b/data/levels/world2/fish.stl index 0d37ea5f8..55b02ebbd 100644 --- a/data/levels/world2/fish.stl +++ b/data/levels/world2/fish.stl @@ -101,7 +101,7 @@ (dispenser (badguy "poisonivy") (cycle 3) - (launchdirection "right") + (direction "right") (x 768) (y 320) ) diff --git a/src/badguy/badguy.cpp b/src/badguy/badguy.cpp index c2b002d88..38d077b5b 100644 --- a/src/badguy/badguy.cpp +++ b/src/badguy/badguy.cpp @@ -102,6 +102,21 @@ BadGuy::update(float elapsed_time) } } +Direction +BadGuy::str2dir( std::string dir_str ) +{ + if( dir_str == "auto" || dir_str == "" ) + return dir; + if( dir_str == "left" ) + return LEFT; + if( dir_str == "right" ) + return RIGHT; + + //default to "auto" + log_warning << "Badguy::str2dir: unknown direction \"" << dir_str << "\"\n"; + return dir; +} + void BadGuy::activate() { diff --git a/src/badguy/badguy.hpp b/src/badguy/badguy.hpp index 425213da7..ebcee6970 100644 --- a/src/badguy/badguy.hpp +++ b/src/badguy/badguy.hpp @@ -156,6 +156,11 @@ protected: Direction dir; + /** + * Get Direction from String. + */ + Direction str2dir( std::string dir_str ); + private: void try_activate(); diff --git a/src/badguy/bouncing_snowball.cpp b/src/badguy/bouncing_snowball.cpp index 5601bfb12..5fce3cf67 100644 --- a/src/badguy/bouncing_snowball.cpp +++ b/src/badguy/bouncing_snowball.cpp @@ -26,8 +26,13 @@ static const float WALKSPEED = 80; BouncingSnowball::BouncingSnowball(const lisp::Lisp& reader) : BadGuy(reader, "images/creatures/bouncing_snowball/bouncing_snowball.sprite") -{ +{ set_direction = false; + reader.get("direction", direction); + if( direction != "auto" && direction != ""){ + set_direction = true; + initial_direction = str2dir( direction ); + } } BouncingSnowball::BouncingSnowball(const Vector& pos, Direction d) @@ -42,6 +47,7 @@ BouncingSnowball::write(lisp::Writer& writer) { writer.start_list("bouncingsnowball"); + writer.write_string("direction", direction); writer.write_float("x", start_position.x); writer.write_float("y", start_position.y); diff --git a/src/badguy/bouncing_snowball.hpp b/src/badguy/bouncing_snowball.hpp index 33a6c7663..6ba417d60 100644 --- a/src/badguy/bouncing_snowball.hpp +++ b/src/badguy/bouncing_snowball.hpp @@ -39,6 +39,7 @@ protected: bool collision_squished(Player& player); bool set_direction; Direction initial_direction; + std::string direction; }; #endif diff --git a/src/badguy/darttrap.cpp b/src/badguy/darttrap.cpp index d86326bd5..6add15810 100644 --- a/src/badguy/darttrap.cpp +++ b/src/badguy/darttrap.cpp @@ -29,6 +29,10 @@ namespace { DartTrap::DartTrap(const lisp::Lisp& reader) : BadGuy(reader, "images/creatures/darttrap/darttrap.sprite"), set_direction(true), initial_direction(LEFT), initial_delay(0), fire_delay(2), ammo(-1), state(IDLE) { + reader.get("direction", direction); + if( direction != "auto" && direction != ""){ + initial_direction = str2dir( direction ); + } reader.get("initial-delay", initial_delay); reader.get("fire-delay", fire_delay); reader.get("ammo", ammo); @@ -40,6 +44,7 @@ void DartTrap::write(lisp::Writer& writer) { writer.start_list("darttrap"); + writer.write_string("direction", direction); writer.write_float("x", start_position.x); writer.write_float("y", start_position.y); writer.write_float("initial-delay", initial_delay); diff --git a/src/badguy/darttrap.hpp b/src/badguy/darttrap.hpp index 461e8525e..09ac5fdad 100644 --- a/src/badguy/darttrap.hpp +++ b/src/badguy/darttrap.hpp @@ -54,6 +54,7 @@ protected: State state; /**< current state */ Timer fire_timer; /**< time until new shot is fired */ + std::string direction; }; #endif diff --git a/src/badguy/dispenser.cpp b/src/badguy/dispenser.cpp index de9f930a5..b06c18df1 100644 --- a/src/badguy/dispenser.cpp +++ b/src/badguy/dispenser.cpp @@ -33,17 +33,17 @@ Dispenser::Dispenser(const lisp::Lisp& reader) : BadGuy(reader, "images/creatures/dispenser/dispenser.sprite") { - std::string launchdirection = ""; - launchdir = dir; - reader.get("launchdirection", launchdirection); - if( launchdirection == "left" || launchdirection == "LEFT" ) - launchdir = LEFT; - if( launchdirection == "right" || launchdirection == "RIGHT" ) - launchdir = RIGHT; + set_direction = false; + reader.get("direction", direction); + if( direction != "auto" && direction != ""){ + set_direction = true; + initial_direction = str2dir( direction ); + dir = str2dir( direction ); + } reader.get("cycle", cycle); reader.get("badguy", badguy); if (badguy == "mrrocket") { - sprite->set_action(launchdir == LEFT ? "working-left" : "working-right"); + sprite->set_action(dir == LEFT ? "working-left" : "working-right"); } else {sprite->set_action("dropper");} bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); @@ -55,6 +55,7 @@ Dispenser::write(lisp::Writer& writer) { writer.start_list("dispenser"); + writer.write_string("direction", direction); writer.write_float("x", start_position.x); writer.write_float("y", start_position.y); writer.write_float("cycle", cycle); @@ -74,7 +75,7 @@ bool Dispenser::collision_squished(Player& player) { //TODO: Should it act like a normal tile when killed? - sprite->set_action(launchdir == LEFT ? "broken-left" : "broken-right"); + sprite->set_action(dir == LEFT ? "broken-left" : "broken-right"); dispense_timer.start(0); player.bounce(*this); kill_squished(player); @@ -94,35 +95,38 @@ Dispenser::active_update(float ) void Dispenser::launch_badguy() { + if( set_direction ){ + dir = initial_direction; + } //FIXME: Does is_offscreen() work right here? if (!is_offscreen()) { if (badguy == "snowball") - Sector::current()->add_object(new SnowBall(Vector(get_pos().x, get_pos().y+32), launchdir)); + Sector::current()->add_object(new SnowBall(Vector(get_pos().x, get_pos().y+32), dir)); else if (badguy == "bouncingsnowball") - Sector::current()->add_object(new BouncingSnowball(Vector(get_pos().x, get_pos().y+32), launchdir)); + Sector::current()->add_object(new BouncingSnowball(Vector(get_pos().x, get_pos().y+32), dir)); else if (badguy == "mrbomb") - Sector::current()->add_object(new MrBomb(Vector(get_pos().x, get_pos().y+32), launchdir)); + Sector::current()->add_object(new MrBomb(Vector(get_pos().x, get_pos().y+32), dir)); else if (badguy == "mriceblock") - Sector::current()->add_object(new MrIceBlock(Vector(get_pos().x, get_pos().y+32), launchdir)); + Sector::current()->add_object(new MrIceBlock(Vector(get_pos().x, get_pos().y+32), dir)); else if (badguy == "snail") - Sector::current()->add_object(new Snail(Vector(get_pos().x, get_pos().y+32), launchdir)); + Sector::current()->add_object(new Snail(Vector(get_pos().x, get_pos().y+32), dir)); else if (badguy == "mrrocket") { - Sector::current()->add_object(new MrRocket(Vector(get_pos().x+(launchdir == LEFT ? -32 : 32), get_pos().y), launchdir));} + Sector::current()->add_object(new MrRocket(Vector(get_pos().x+(dir == LEFT ? -32 : 32), get_pos().y), dir));} else if (badguy == "poisonivy") - Sector::current()->add_object(new PoisonIvy(Vector(get_pos().x, get_pos().y+32), launchdir)); + Sector::current()->add_object(new PoisonIvy(Vector(get_pos().x, get_pos().y+32), dir)); else if (badguy == "skullyhop") - Sector::current()->add_object(new SkullyHop(Vector(get_pos().x, get_pos().y+44), launchdir)); + Sector::current()->add_object(new SkullyHop(Vector(get_pos().x, get_pos().y+44), dir)); else if (badguy == "random") { switch (systemRandom.rand(7)) { - case 0: Sector::current()->add_object(new SnowBall(Vector(get_pos().x, get_pos().y+32), launchdir)); break; - case 1: Sector::current()->add_object(new BouncingSnowball(Vector(get_pos().x, get_pos().y+32), launchdir)); break; - case 2: Sector::current()->add_object(new MrBomb(Vector(get_pos().x, get_pos().y+32), launchdir)); break; - case 3: Sector::current()->add_object(new MrIceBlock(Vector(get_pos().x, get_pos().y+32), launchdir)); break; - case 4: Sector::current()->add_object(new PoisonIvy(Vector(get_pos().x, get_pos().y+32), launchdir)); break; - case 5: Sector::current()->add_object(new Snail(Vector(get_pos().x, get_pos().y+32), launchdir)); break; - case 6: Sector::current()->add_object(new SkullyHop(Vector(get_pos().x, get_pos().y+44), launchdir)); break; + case 0: Sector::current()->add_object(new SnowBall(Vector(get_pos().x, get_pos().y+32), dir)); break; + case 1: Sector::current()->add_object(new BouncingSnowball(Vector(get_pos().x, get_pos().y+32), dir)); break; + case 2: Sector::current()->add_object(new MrBomb(Vector(get_pos().x, get_pos().y+32), dir)); break; + case 3: Sector::current()->add_object(new MrIceBlock(Vector(get_pos().x, get_pos().y+32), dir)); break; + case 4: Sector::current()->add_object(new PoisonIvy(Vector(get_pos().x, get_pos().y+32), dir)); break; + case 5: Sector::current()->add_object(new Snail(Vector(get_pos().x, get_pos().y+32), dir)); break; + case 6: Sector::current()->add_object(new SkullyHop(Vector(get_pos().x, get_pos().y+44), dir)); break; } } } diff --git a/src/badguy/dispenser.hpp b/src/badguy/dispenser.hpp index c9fa524a1..2ba8ba219 100644 --- a/src/badguy/dispenser.hpp +++ b/src/badguy/dispenser.hpp @@ -40,7 +40,9 @@ protected: float cycle; std::string badguy; Timer dispense_timer; - Direction launchdir; + bool set_direction; + Direction initial_direction; + std::string direction; }; #endif diff --git a/src/badguy/mrbomb.cpp b/src/badguy/mrbomb.cpp index 3d90f2fac..280596e6d 100644 --- a/src/badguy/mrbomb.cpp +++ b/src/badguy/mrbomb.cpp @@ -28,6 +28,11 @@ MrBomb::MrBomb(const lisp::Lisp& reader) : BadGuy(reader, "images/creatures/mr_bomb/mr_bomb.sprite") { set_direction = false; + reader.get("direction", direction); + if( direction != "auto" && direction != ""){ + set_direction = true; + initial_direction = str2dir( direction ); + } } MrBomb::MrBomb(const Vector& pos, Direction d) @@ -42,6 +47,7 @@ MrBomb::write(lisp::Writer& writer) { writer.start_list("mrbomb"); + writer.write_string("direction", direction); writer.write_float("x", start_position.x); writer.write_float("y", start_position.y); diff --git a/src/badguy/mrbomb.hpp b/src/badguy/mrbomb.hpp index c8a148744..4759f8be4 100644 --- a/src/badguy/mrbomb.hpp +++ b/src/badguy/mrbomb.hpp @@ -41,6 +41,7 @@ protected: bool collision_squished(Player& player); bool set_direction; Direction initial_direction; + std::string direction; }; #endif diff --git a/src/badguy/mriceblock.cpp b/src/badguy/mriceblock.cpp index efc155638..ca0431a22 100644 --- a/src/badguy/mriceblock.cpp +++ b/src/badguy/mriceblock.cpp @@ -31,7 +31,12 @@ namespace { MrIceBlock::MrIceBlock(const lisp::Lisp& reader) : BadGuy(reader, "images/creatures/mr_iceblock/mr_iceblock.sprite"), ice_state(ICESTATE_NORMAL), squishcount(0) { + reader.get("direction", direction); set_direction = false; + if( direction != "auto" && direction != ""){ + set_direction = true; + initial_direction = str2dir( direction ); + } sound_manager->preload("sounds/iceblock_bump.wav"); sound_manager->preload("sounds/stomp.wav"); sound_manager->preload("sounds/kick.wav"); @@ -52,6 +57,7 @@ MrIceBlock::write(lisp::Writer& writer) { writer.start_list("mriceblock"); + writer.write_string("direction", direction); writer.write_float("x", start_position.x); writer.write_float("y", start_position.y); diff --git a/src/badguy/mriceblock.hpp b/src/badguy/mriceblock.hpp index 35700fa98..ca6c59d85 100644 --- a/src/badguy/mriceblock.hpp +++ b/src/badguy/mriceblock.hpp @@ -61,6 +61,7 @@ private: int squishcount; bool set_direction; Direction initial_direction; + std::string direction; }; #endif diff --git a/src/badguy/mrtree.cpp b/src/badguy/mrtree.cpp index 3f9221119..9324b9327 100644 --- a/src/badguy/mrtree.cpp +++ b/src/badguy/mrtree.cpp @@ -34,6 +34,13 @@ static const float POISONIVY_Y_OFFSET = 24; MrTree::MrTree(const lisp::Lisp& reader) : BadGuy(reader, "images/creatures/mr_tree/mr_tree.sprite"), mystate(STATE_BIG) { + reader.get("direction", direction); + set_direction = true; + if( direction != "auto" && direction != ""){ + set_direction = true; + initial_direction = str2dir( direction ); + dir = str2dir( direction ); + } sprite->set_action(dir == LEFT ? "large-left" : "large-right"); sound_manager->preload("sounds/mr_tree.ogg"); sound_manager->preload("sounds/mr_treehit.ogg"); @@ -44,6 +51,7 @@ MrTree::write(lisp::Writer& writer) { writer.start_list("mrtree"); + writer.write_string("direction", direction); writer.write_float("x", start_position.x); writer.write_float("y", start_position.y); @@ -53,6 +61,9 @@ MrTree::write(lisp::Writer& writer) void MrTree::activate() { + if( set_direction ){ + dir = initial_direction; + } if (mystate == STATE_BIG) { physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED); sprite->set_action(dir == LEFT ? "large-left" : "large-right"); diff --git a/src/badguy/mrtree.hpp b/src/badguy/mrtree.hpp index 652a00e6b..9795a6d6b 100644 --- a/src/badguy/mrtree.hpp +++ b/src/badguy/mrtree.hpp @@ -44,6 +44,9 @@ protected: Timer invincible_timer; bool collision_squished(Player& player); + std::string direction; + bool set_direction; + Direction initial_direction; }; #endif diff --git a/src/badguy/poisonivy.cpp b/src/badguy/poisonivy.cpp index e442a9a0b..302fb4c81 100644 --- a/src/badguy/poisonivy.cpp +++ b/src/badguy/poisonivy.cpp @@ -27,6 +27,11 @@ PoisonIvy::PoisonIvy(const lisp::Lisp& reader) : BadGuy(reader, "images/creatures/poison_ivy/poison_ivy.sprite") { set_direction = false; + reader.get("direction", direction); + if( direction != "auto" && direction != ""){ + set_direction = true; + initial_direction = str2dir( direction ); + } } PoisonIvy::PoisonIvy(const Vector& pos, Direction d) @@ -41,6 +46,7 @@ PoisonIvy::write(lisp::Writer& writer) { writer.start_list("poisonivy"); + writer.write_string("direction", direction); writer.write_float("x", start_position.x); writer.write_float("y", start_position.y); diff --git a/src/badguy/poisonivy.hpp b/src/badguy/poisonivy.hpp index a24cfeb53..6ee178d8f 100644 --- a/src/badguy/poisonivy.hpp +++ b/src/badguy/poisonivy.hpp @@ -39,6 +39,7 @@ protected: bool collision_squished(Player& player); bool set_direction; Direction initial_direction; + std::string direction; }; #endif diff --git a/src/badguy/snail.cpp b/src/badguy/snail.cpp index dea697baf..d53e91456 100644 --- a/src/badguy/snail.cpp +++ b/src/badguy/snail.cpp @@ -32,7 +32,12 @@ namespace { Snail::Snail(const lisp::Lisp& reader) : BadGuy(reader, "images/creatures/snail/snail.sprite"), state(STATE_NORMAL), squishcount(0) { + reader.get("direction", direction); set_direction = false; + if( direction != "auto" && direction != ""){ + set_direction = true; + initial_direction = str2dir( direction ); + } sound_manager->preload("sounds/iceblock_bump.wav"); sound_manager->preload("sounds/stomp.wav"); sound_manager->preload("sounds/kick.wav"); @@ -53,6 +58,7 @@ Snail::write(lisp::Writer& writer) { writer.start_list("snail"); + writer.write_string("direction", direction); writer.write_float("x", start_position.x); writer.write_float("y", start_position.y); diff --git a/src/badguy/snail.hpp b/src/badguy/snail.hpp index 45904e9be..50e230179 100644 --- a/src/badguy/snail.hpp +++ b/src/badguy/snail.hpp @@ -59,6 +59,7 @@ private: int squishcount; bool set_direction; Direction initial_direction; + std::string direction; }; #endif diff --git a/src/badguy/snowball.cpp b/src/badguy/snowball.cpp index c20b65f92..22dce8e8f 100644 --- a/src/badguy/snowball.cpp +++ b/src/badguy/snowball.cpp @@ -26,15 +26,12 @@ static const float WALKSPEED = 80; SnowBall::SnowBall(const lisp::Lisp& reader) : BadGuy(reader, "images/creatures/snowball/snowball.sprite") { - /* - fluffy = false; - reader.get("fluffy",fluffy); - if (fluffy) { - delete sprite; - sprite = sprite_manager->create("images/creatures/fluffy/fluffy.sprite"); - } - */ set_direction = false; + reader.get("direction", direction); + if( direction != "auto" && direction != ""){ + set_direction = true; + initial_direction = str2dir( direction ); + } } SnowBall::SnowBall(const Vector& pos, Direction d) @@ -49,6 +46,7 @@ SnowBall::write(lisp::Writer& writer) { writer.start_list("snowball"); + writer.write_string("direction", direction); writer.write_float("x", start_position.x); writer.write_float("y", start_position.y); /* diff --git a/src/badguy/snowball.hpp b/src/badguy/snowball.hpp index d13c03fb8..eab2c069b 100644 --- a/src/badguy/snowball.hpp +++ b/src/badguy/snowball.hpp @@ -39,7 +39,7 @@ protected: bool collision_squished(Player& player); bool set_direction; Direction initial_direction; - //bool fluffy; + std::string direction; }; #endif diff --git a/src/badguy/spiky.cpp b/src/badguy/spiky.cpp index fbe27eee8..cf498c3c7 100644 --- a/src/badguy/spiky.cpp +++ b/src/badguy/spiky.cpp @@ -26,6 +26,12 @@ static const float WALKSPEED = 80; Spiky::Spiky(const lisp::Lisp& reader) : BadGuy(reader, "images/creatures/spiky/spiky.sprite") { + reader.get("direction", direction); + set_direction = false; + if( direction != "auto" && direction != ""){ + set_direction = true; + initial_direction = str2dir( direction ); + } } void @@ -33,6 +39,7 @@ Spiky::write(lisp::Writer& writer) { writer.start_list("spiky"); + writer.write_string("direction", direction); writer.write_float("x", start_position.x); writer.write_float("y", start_position.y); @@ -42,6 +49,9 @@ Spiky::write(lisp::Writer& writer) void Spiky::activate() { + if( set_direction ){ + dir = initial_direction; + } physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED); sprite->set_action(dir == LEFT ? "left" : "right"); } diff --git a/src/badguy/spiky.hpp b/src/badguy/spiky.hpp index f4cbe69dd..75d2f5f26 100644 --- a/src/badguy/spiky.hpp +++ b/src/badguy/spiky.hpp @@ -35,6 +35,10 @@ public: virtual Spiky* clone() const { return new Spiky(*this); } +private: + bool set_direction; + Direction initial_direction; + std::string direction; }; #endif diff --git a/src/badguy/sspiky.cpp b/src/badguy/sspiky.cpp index bd6a0dcd3..a70d2f7be 100644 --- a/src/badguy/sspiky.cpp +++ b/src/badguy/sspiky.cpp @@ -27,6 +27,12 @@ static const float WAKE_TIME = .5; SSpiky::SSpiky(const lisp::Lisp& reader) : BadGuy(reader, "images/creatures/spiky/sleepingspiky.sprite"), state(SSPIKY_SLEEPING) { + set_direction = false; + reader.get("direction", direction); + if( direction != "auto" && direction != ""){ + set_direction = true; + initial_direction = str2dir( direction ); + } } void @@ -34,6 +40,7 @@ SSpiky::write(lisp::Writer& writer) { writer.start_list("sspiky"); + writer.write_string("direction", direction); writer.write_float("x", start_position.x); writer.write_float("y", start_position.y); @@ -43,9 +50,9 @@ SSpiky::write(lisp::Writer& writer) void SSpiky::activate() { - //FIXME: turns sspiky around for debugging - dir = dir == LEFT ? RIGHT : LEFT; - + if( set_direction ){ + dir = initial_direction; + } state = SSPIKY_SLEEPING; physic.set_velocity_x(0); sprite->set_action(dir == LEFT ? "sleeping-left" : "sleeping-right"); diff --git a/src/badguy/sspiky.hpp b/src/badguy/sspiky.hpp index bb7741930..aa6c7958d 100644 --- a/src/badguy/sspiky.hpp +++ b/src/badguy/sspiky.hpp @@ -44,6 +44,9 @@ protected: SSPIKY_WALKING }; SSpikyState state; + std::string direction; + bool set_direction; + Direction initial_direction; }; #endif diff --git a/src/badguy/zeekling.cpp b/src/badguy/zeekling.cpp index 5e30d2052..479643a7d 100644 --- a/src/badguy/zeekling.cpp +++ b/src/badguy/zeekling.cpp @@ -29,6 +29,11 @@ Zeekling::Zeekling(const lisp::Lisp& reader) : BadGuy(reader, "images/creatures/zeekling/zeekling.sprite") { set_direction = false; + reader.get("direction", direction); + if( direction != "auto" && direction != ""){ + set_direction = true; + initial_direction = str2dir( direction ); + } state = FLYING; } @@ -45,6 +50,7 @@ Zeekling::write(lisp::Writer& writer) { writer.start_list("zeekling"); + writer.write_string("direction", direction); writer.write_float("x", start_position.x); writer.write_float("y", start_position.y); diff --git a/src/badguy/zeekling.hpp b/src/badguy/zeekling.hpp index 11b819923..0b3532e0b 100644 --- a/src/badguy/zeekling.hpp +++ b/src/badguy/zeekling.hpp @@ -56,7 +56,7 @@ private: bool should_we_dive(); void onBumpHorizontal(); void onBumpVertical(); - + std::string direction; }; #endif