From: Christoph Sommer Date: Sat, 26 May 2007 14:21:12 +0000 (+0000) Subject: WillOWisp badguys can now be trapped inside empty Lanterns. X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=9f9a92cd9d8433c6d4d63b0178fd038a95b9e1a1;p=supertux.git WillOWisp badguys can now be trapped inside empty Lanterns. Added MatzeB's drafts of World2 boss, the ghost tree. SVN-Revision: 5019 --- diff --git a/data/images/creatures/ghosttree/ghosttree.png b/data/images/creatures/ghosttree/ghosttree.png new file mode 100644 index 000000000..d7d56ab47 Binary files /dev/null and b/data/images/creatures/ghosttree/ghosttree.png differ diff --git a/data/images/creatures/ghosttree/ghosttree.sprite b/data/images/creatures/ghosttree/ghosttree.sprite new file mode 100644 index 000000000..7cb246426 --- /dev/null +++ b/data/images/creatures/ghosttree/ghosttree.sprite @@ -0,0 +1,8 @@ +(supertux-sprite + (action + (name "default") + (images + "ghosttree.png" + ) + ) +) diff --git a/data/images/creatures/ghosttree/root.png b/data/images/creatures/ghosttree/root.png new file mode 100644 index 000000000..ecb83a193 Binary files /dev/null and b/data/images/creatures/ghosttree/root.png differ diff --git a/data/images/creatures/ghosttree/root.sprite b/data/images/creatures/ghosttree/root.sprite new file mode 100644 index 000000000..7e54ff1fe --- /dev/null +++ b/data/images/creatures/ghosttree/root.sprite @@ -0,0 +1,6 @@ +(supertux-sprite + (action + (name "default") + (images "root.png") + ) +) diff --git a/data/images/objects/lantern/lantern-off-open.png b/data/images/objects/lantern/lantern-off-open.png new file mode 100644 index 000000000..478208577 Binary files /dev/null and b/data/images/objects/lantern/lantern-off-open.png differ diff --git a/data/images/objects/lantern/lantern.sprite b/data/images/objects/lantern/lantern.sprite index ab7513bb5..237854442 100644 --- a/data/images/objects/lantern/lantern.sprite +++ b/data/images/objects/lantern/lantern.sprite @@ -14,4 +14,9 @@ (hitbox 16 8 34 41) (images "lantern-off.png") ) + (action + (name "off-open") + (hitbox 16 8 34 41) + (images "lantern-off-open.png") + ) ) diff --git a/data/levels/test/ghosttree.stl b/data/levels/test/ghosttree.stl new file mode 100644 index 000000000..d966afb4b --- /dev/null +++ b/data/levels/test/ghosttree.stl @@ -0,0 +1,134 @@ +(supertux-level + (version 2) + (name (_ "No More Mr Ice Guy")) + (author "SuperTux Team") + (license "GPL 2+ / CC-by-sa 3.0") + (sector + (name "main") + (music "music/bossattack.ogg") + (init-script " +Effect.fade_in(1); +") + (ambient-light 0.5 0.5 0.5) + (background + (speed 0.5) + (image "images/background/semi_arctic.jpg") + ) + (camera + (mode "normal") + ) + (spawnpoint + (name "main") + (x 480) + (y 448) + ) + (lantern + (x 540) + (y 448) + (color 0 0 0) + ) + (lantern + (x 540) + (y 348) + (color 0 0 0) + ) + (lantern + (x 540) + (y 248) + (color 0 0 0) + ) + (lantern + (x 540) + (y 148) + (color 0 0 0) + ) + (tilemap + (z-pos -100) + (solid #f) + (width 25) + (height 20) + (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 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 + 8 8 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 8 8 + 14 14 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 14 14 + 11 11 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 11 11 + 11 11 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 11 11 + 11 11 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 11 11 + 11 11 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 11 11 + 11 11 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 11 11 + 11 11 21 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 22 11 11 + 11 11 20 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 23 11 11 + ) + ) + (tilemap + (z-pos 100) + (solid #f) + (width 25) + (height 20) + (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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + ) + ) + (ghosttree + (x 150) + (y 100) + ) + ) +) diff --git a/data/levels/test/lantern.stl b/data/levels/test/lantern.stl new file mode 100644 index 000000000..1e524ea31 --- /dev/null +++ b/data/levels/test/lantern.stl @@ -0,0 +1,114 @@ +(supertux-level + (version 2) + (name (_ "Unnamed")) + (author "christoph") + (sector + (name "main") + (ambient-light 0.314519 0.314519 0.314519) + (background + (speed 0.5) + (image-top "images/background/BlueRock_Forest/blue-top.jpg") + (image "images/background/BlueRock_Forest/blue-middle.jpg") + (image-bottom "images/background/BlueRock_Forest/blue-bottom.jpg") + ) + (camera + (mode "normal") + ) + (lantern + (x 752) + (y 136) + (color 1 1 0) + ) + (lantern + (x 240) + (y 328) + (color 0 0 0) + ) + (spawnpoint + (name "main") + (x 96) + (y 96) + ) + (tilemap + (z-pos -100) + (solid #f) + (name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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 + ) + ) + (tilemap + (z-pos 0) + (solid #t) + (name "Interactive") + (width 48) + (height 16) + (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 1367 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1404 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1404 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1404 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1404 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1404 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 1368 1368 1384 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1367 1368 1368 1368 1368 1368 1371 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 1372 1372 1373 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1404 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 1372 1372 1373 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1404 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 1372 1372 1383 1380 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1370 1371 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 1372 1372 1372 1373 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1404 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 1372 1372 1372 1373 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1404 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 1372 1372 1372 1383 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1368 1371 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 1372 + ) + ) + (tilemap + (z-pos 100) + (solid #f) + (name "Foreground") + (width 48) + (height 16) + (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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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 + ) + ) + (willowisp + (sector "main") + (spawnpoint "main") + (x 736) + (y 32) + ) + ) +) diff --git a/src/badguy/badguy.cpp b/src/badguy/badguy.cpp index 0d654bb25..2d1b68ef0 100644 --- a/src/badguy/badguy.cpp +++ b/src/badguy/badguy.cpp @@ -154,7 +154,7 @@ BadGuy::deactivate() } void -BadGuy::save(lisp::Writer& ) +BadGuy::write(lisp::Writer& ) { log_warning << "tried to write out a generic badguy" << std::endl; } diff --git a/src/badguy/badguy.hpp b/src/badguy/badguy.hpp index 7013542ec..f9592868d 100644 --- a/src/badguy/badguy.hpp +++ b/src/badguy/badguy.hpp @@ -73,7 +73,7 @@ public: /** Writes out the badguy into the included lisp::Writer. Useful e.g. when * converting an old-format level to the new format. */ - virtual void save(lisp::Writer& writer); + virtual void write(lisp::Writer& writer); /** * True if this badguy can break bricks or open bonusblocks in his current form. diff --git a/src/badguy/ghosttree.cpp b/src/badguy/ghosttree.cpp new file mode 100644 index 000000000..56ca1b39e --- /dev/null +++ b/src/badguy/ghosttree.cpp @@ -0,0 +1,129 @@ +// $Id$ +// +// SuperTux - Boss "GhostTree" +// Copyright (C) 2007 Matthias Braun +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include + +#include "ghosttree.hpp" +#include "treewillowisp.hpp" +#include "root.hpp" + +static const int WILLOWISP_COUNT = 10; + +GhostTree::GhostTree(const lisp::Lisp& lisp) + : BadGuy(lisp, "images/creatures/ghosttree/ghosttree.sprite", + LAYER_OBJECTS - 10), + willowisp_counter(0), willo_spawn_y(0), willo_radius(200), + willo_speed(1.8f), willo_color(0), treecolor(0) +{ +} + +GhostTree::~GhostTree() +{ +} + +void +GhostTree::activate() +{ + willowisp_timer.start(1.0f, true); + colorchange_timer.start(13, true); + root_timer.start(5, true); + set_group(COLGROUP_DISABLED); +} + +void +GhostTree::active_update(float elapsed_time) +{ + (void) elapsed_time; + + if(colorchange_timer.check()) { + treecolor++; + if(treecolor > 5) + treecolor = 0; + + switch(treecolor) { + case 0: sprite->set_color(Color(1, 0, 0)); break; + case 1: sprite->set_color(Color(0, 1, 0)); break; + case 2: sprite->set_color(Color(0, 0, 1)); break; + case 3: sprite->set_color(Color(1, 1, 0)); break; + case 4: sprite->set_color(Color(1, 0, 1)); break; + case 5: sprite->set_color(Color(0, 1, 1)); break; + default: assert(false); + } + } + + if(willowisp_timer.check()) { + if(willowisp_counter < WILLOWISP_COUNT) { + Vector pos = get_bbox().get_middle(); + pos.y += willo_spawn_y; + TreeWillOWisp *willowisp + = new TreeWillOWisp(pos, 200 + willo_radius, willo_speed); + + Sector::current()->add_object(willowisp); + willowisp_counter++; + + willo_spawn_y -= 40; + if(willo_spawn_y < -160) + willo_spawn_y = 0; + + willo_radius += 20; + if(willo_radius > 120) + willo_radius = 0; + + if(willo_speed == 1.8f) { + willo_speed = 1.5f; + } else { + willo_speed = 1.8f; + } + + willo_color++; + if(willo_color > 5) + willo_color = 0; + switch(willo_color) { + case 0: willowisp->set_color(Color(1, 0, 0)); break; + case 1: willowisp->set_color(Color(0, 1, 0)); break; + case 2: willowisp->set_color(Color(0, 0, 1)); break; + case 3: willowisp->set_color(Color(1, 1, 0)); break; + case 4: willowisp->set_color(Color(1, 0, 1)); break; + case 5: willowisp->set_color(Color(0, 1, 1)); break; + default: assert(false); + } + } + } + + if(root_timer.check()) { + /* TODO indicate root with an animation */ + Player* player = get_nearest_player(); + Root* root = new Root(Vector(player->get_bbox().get_left(), get_bbox().get_bottom())); + Sector::current()->add_object(root); + } +} + +void +GhostTree::willowisp_died() +{ + willowisp_counter--; +} + +void +GhostTree::start_sucking() +{ + /* TODO create a particle system to indicate the sucking... */ +} + +IMPLEMENT_FACTORY(GhostTree, "ghosttree"); + diff --git a/src/badguy/ghosttree.hpp b/src/badguy/ghosttree.hpp new file mode 100644 index 000000000..c52b6a0a3 --- /dev/null +++ b/src/badguy/ghosttree.hpp @@ -0,0 +1,49 @@ +// $Id$ +// +// SuperTux - Boss "GhostTree" +// Copyright (C) 2007 Matthias Braun +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#ifndef __GHOSTTREE_H__ +#define __GHOSTTREE_H__ + +#include "badguy.hpp" + +class GhostTree : public BadGuy +{ +public: + GhostTree(const lisp::Lisp& lisp); + ~GhostTree(); + + void activate(); + void active_update(float elapsed_time); + void willowisp_died(); + void start_sucking(); + +private: + int willowisp_counter; + Timer willowisp_timer; + float willo_spawn_y; + float willo_radius; + float willo_speed; + int willo_color; + + Timer colorchange_timer; + Timer root_timer; + int treecolor; +}; + +#endif + diff --git a/src/badguy/root.cpp b/src/badguy/root.cpp new file mode 100644 index 000000000..77a220af5 --- /dev/null +++ b/src/badguy/root.cpp @@ -0,0 +1,58 @@ +// $Id$ +// +// SuperTux - "Will-O-Wisp" Badguy +// 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 +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA. +#include + +#include "root.hpp" + +static const float SPEED = 5; + +Root::Root(const Vector& pos) + : BadGuy(pos, "images/creatures/ghosttree/root.sprite", LAYER_OBJECTS+20), + ypos(0), speed(-SPEED) +{ + //ypos = sprite->get_height(); +} + +Root::~Root() +{ +} + +void +Root::activate() +{ + set_pos(start_position + Vector(0, ypos)); + std::cout << "SetPos: " << get_pos() << "\n"; +} + +void +Root::active_update(float elapsed_time) +{ + ypos += elapsed_time * speed; + if(ypos < 0) { + ypos = 0; + speed = -speed; + } + if(speed > 0 && ypos > sprite->get_height()) { + remove_me(); + } + set_pos(start_position + Vector(0, ypos)); + std::cout << "SetPos: " << get_pos() << "\n"; +} + diff --git a/src/badguy/root.hpp b/src/badguy/root.hpp new file mode 100644 index 000000000..93d641e4e --- /dev/null +++ b/src/badguy/root.hpp @@ -0,0 +1,38 @@ +// $Id$ +// +// SuperTux - Boss "GhostTree" +// Copyright (C) 2007 Matthias Braun +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#ifndef __ROOT_H__ +#define __ROOT_H__ + +#include "badguy.hpp" + +class Root : public BadGuy +{ +public: + Root(const Vector& pos); + ~Root(); + + void activate(); + void active_update(float elapsed_time); + +private: + float ypos; + float speed; +}; + +#endif diff --git a/src/badguy/treewillowisp.cpp b/src/badguy/treewillowisp.cpp new file mode 100644 index 000000000..c31531ff3 --- /dev/null +++ b/src/badguy/treewillowisp.cpp @@ -0,0 +1,117 @@ +// $Id$ +// +// SuperTux - "Will-O-Wisp" Badguy +// Copyright (C) 2007 Matthias Braun +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA. +#include + +#include "treewillowisp.hpp" +#include "object/lantern.hpp" + +static const std::string SOUNDFILE = "sounds/willowisp.wav"; + +TreeWillOWisp::TreeWillOWisp(const Vector& pos, float radius, float speed) + : BadGuy(pos, "images/creatures/willowisp/willowisp.sprite", + LAYER_OBJECTS - 20), mystate(STATE_DEFAULT) +{ + sound_manager->preload(SOUNDFILE); + + this->radius = radius; + this->angle = 0; + this->speed = speed; +} + +TreeWillOWisp::~TreeWillOWisp() +{ +} + +void +TreeWillOWisp::activate() +{ + sound_source.reset(sound_manager->create_sound_source(SOUNDFILE)); + sound_source->set_position(get_pos()); + sound_source->set_looping(true); + sound_source->set_gain(2.0); + sound_source->set_reference_distance(32); + sound_source->play(); + + set_group(COLGROUP_MOVING); +} + +void +TreeWillOWisp::vanish() +{ + mystate = STATE_VANISHING; + sprite->set_action("vanishing", 1); + set_group(COLGROUP_DISABLED); +} + +HitResponse +TreeWillOWisp::collision_player(Player& player, const CollisionHit& hit) +{ + (void) player; + (void) hit; + + return FORCE_MOVE; +} + +bool +TreeWillOWisp::collides(GameObject& other, const CollisionHit& ) { + if (dynamic_cast(&other)) return true; + return false; +} + +void +TreeWillOWisp::active_update(float elapsed_time) +{ + + // remove TreeWillOWisp if it has completely vanished + if (mystate == STATE_VANISHING) { + if(sprite->animation_done()) { + remove_me(); + return; + } + } + + angle = fmodf(angle + elapsed_time * speed, (float) (2*M_PI)); + Vector newpos(start_position.x + sin(angle) * radius, start_position.y); + movement = newpos - get_pos(); + float sizemod = cos(angle) * 0.8f; + /* TODO: modify sprite size */ + + sound_source->set_position(get_pos()); + + if(sizemod < 0) { + layer = LAYER_OBJECTS + 5; + } else { + layer = LAYER_OBJECTS - 20; + } +} + +void +TreeWillOWisp::set_color(const Color& color) +{ + this->color = color; + sprite->set_color(color); +} + +Color +TreeWillOWisp::get_color() const +{ + return color; +} + diff --git a/src/badguy/treewillowisp.hpp b/src/badguy/treewillowisp.hpp new file mode 100644 index 000000000..b57dcc76e --- /dev/null +++ b/src/badguy/treewillowisp.hpp @@ -0,0 +1,62 @@ +// $Id$ +// +// SuperTux - "Will-O-Wisp" Badguy +// Copyright (C) 2007 Matthias Braun +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA. + +#ifndef __TREEWILLOWISP_H__ +#define __TREEWILLOWISP_H__ + +#include "badguy.hpp" + +class TreeWillOWisp : public BadGuy +{ +public: + TreeWillOWisp(const Vector& pos, float radius, float speed); + virtual ~TreeWillOWisp(); + + void activate(); + + /** + * make TreeWillOWisp vanish + */ + void vanish(); + + void active_update(float elapsed_time); + void set_color(const Color& color); + Color get_color() const; + +protected: + virtual bool collides(GameObject& other, const CollisionHit& hit); + HitResponse collision_player(Player& player, const CollisionHit& hit); + +private: + enum MyState { + STATE_DEFAULT, STATE_VANISHING + }; + MyState mystate; + + Color color; + float angle; + float radius; + float speed; + + std::auto_ptr sound_source; +}; + +#endif + diff --git a/src/badguy/willowisp.cpp b/src/badguy/willowisp.cpp index 6e069e8c3..657bed89a 100644 --- a/src/badguy/willowisp.cpp +++ b/src/badguy/willowisp.cpp @@ -22,6 +22,8 @@ #include "willowisp.hpp" #include "log.hpp" #include "game_session.hpp" +#include "object/lantern.hpp" +#include "object/player.hpp" static const float FLYSPEED = 64; /**< speed in px per second */ static const float TRACK_RANGE = 384; /**< at what distance to start tracking the player */ @@ -84,8 +86,7 @@ WillOWisp::active_update(float elapsed_time) Vector dir = dist.unit(); movement = dir*elapsed_time*FLYSPEED; } else { - mystate = STATE_VANISHING; - sprite->set_action("vanishing", 1); + vanish(); } sound_source->set_position(get_pos()); } @@ -97,6 +98,8 @@ WillOWisp::active_update(float elapsed_time) } if (mystate == STATE_VANISHING) { + Vector dir = dist.unit(); + movement = dir*elapsed_time*FLYSPEED; if(sprite->animation_done()) { remove_me(); } @@ -140,6 +143,21 @@ WillOWisp::kill_fall() { } +void +WillOWisp::vanish() +{ + mystate = STATE_VANISHING; + sprite->set_action("vanishing", 1); + set_group(COLGROUP_DISABLED); +} + +bool +WillOWisp::collides(GameObject& other, const CollisionHit& ) { + if (dynamic_cast(&other)) return true; + if (dynamic_cast(&other)) return true; + return false; +} + HitResponse WillOWisp::collision_player(Player& player, const CollisionHit& ) { if(player.is_invincible()) return ABORT_MOVE; diff --git a/src/badguy/willowisp.hpp b/src/badguy/willowisp.hpp index 51bdc1f77..78ea5c762 100644 --- a/src/badguy/willowisp.hpp +++ b/src/badguy/willowisp.hpp @@ -35,9 +35,15 @@ public: void active_update(float elapsed_time); void kill_fall(); + /** + * make WillOWisp vanish + */ + void vanish(); + virtual void draw(DrawingContext& context); protected: + virtual bool collides(GameObject& other, const CollisionHit& hit); HitResponse collision_player(Player& player, const CollisionHit& hit); private: diff --git a/src/moving_object.hpp b/src/moving_object.hpp index 31f47ad23..69d36a331 100644 --- a/src/moving_object.hpp +++ b/src/moving_object.hpp @@ -87,6 +87,16 @@ public: { (void) hit; } + /** + * when 2 objects collided, we will first call the pre_collision_check + * functions of both objects that can decide on how to react to the collision. + */ + virtual bool collides(GameObject& other, const CollisionHit& hit) + { + (void) other; + (void) hit; + return true; + } /** this function is called when the object collided with any other object */ virtual HitResponse collision(GameObject& other, const CollisionHit& hit) = 0; /** called when tiles with special attributes have been touched */ diff --git a/src/object/lantern.cpp b/src/object/lantern.cpp index e877a72d2..a91b15ffc 100644 --- a/src/object/lantern.cpp +++ b/src/object/lantern.cpp @@ -22,6 +22,8 @@ #include "lantern.hpp" #include "sprite/sprite_manager.hpp" #include "object_factory.hpp" +#include "badguy/willowisp.hpp" +#include "badguy/treewillowisp.hpp" Lantern::Lantern(const lisp::Lisp& reader) : Rock(reader, "images/objects/lantern/lantern.sprite"), @@ -66,4 +68,48 @@ Lantern::draw(DrawingContext& context){ context.pop_target(); } +HitResponse Lantern::collision(GameObject& other, const CollisionHit& hit) { + if ((grabbed) && lightcolor.red == 0 && lightcolor.green == 0 && lightcolor.blue == 0){ + WillOWisp* wow = dynamic_cast(&other); + if (wow) { + // collided with WillOWisp while grabbed and unlit + lightcolor = Color(0,1,0); + updateColor(); + wow->vanish(); + } + TreeWillOWisp* twow = dynamic_cast(&other); + if (twow) { + // collided with TreeWillOWisp while grabbed and unlit + lightcolor = twow->get_color(); + updateColor(); + twow->vanish(); + } + } + return Rock::collision(other, hit); +} + +void +Lantern::grab(MovingObject& object, const Vector& pos, Direction dir) +{ + Rock::grab(object, pos, dir); + + // if lantern is not lit, draw it as opened + if(lightcolor.red == 0 && lightcolor.green == 0 && lightcolor.blue == 0){ + sprite->set_action("off-open"); + } + +} + +void +Lantern::ungrab(MovingObject& object, Direction dir) +{ + Rock::ungrab(object, dir); + + // if lantern is not lit, it was drawn as opened while grabbed. Now draw it as closed again + if(lightcolor.red == 0 && lightcolor.green == 0 && lightcolor.blue == 0){ + sprite->set_action("off"); + } +} + IMPLEMENT_FACTORY(Lantern, "lantern"); + diff --git a/src/object/lantern.hpp b/src/object/lantern.hpp index 5bf7dc729..f99110585 100644 --- a/src/object/lantern.hpp +++ b/src/object/lantern.hpp @@ -33,6 +33,11 @@ public: void draw(DrawingContext& context); ~Lantern(); + HitResponse collision(GameObject& other, const CollisionHit& hit); + + void grab(MovingObject& object, const Vector& pos, Direction dir); + void ungrab(MovingObject& object, Direction dir); + private: Color lightcolor; Sprite* lightsprite; diff --git a/src/object/rock.cpp b/src/object/rock.cpp index f4355788d..e1421f2ce 100644 --- a/src/object/rock.cpp +++ b/src/object/rock.cpp @@ -72,6 +72,9 @@ Rock::update(float elapsed_time) void Rock::collision_solid(const CollisionHit& hit) { + if(grabbed) { + return; + } if(hit.top || hit.bottom) physic.set_velocity_y(0); if(hit.left || hit.right) @@ -88,6 +91,9 @@ Rock::collision_solid(const CollisionHit& hit) HitResponse Rock::collision(GameObject& other, const CollisionHit& hit) { + if(grabbed) { + return PASSTHROUGH; + } if(!on_ground) { if(hit.bottom && physic.get_velocity_y() > 200) { MovingObject* moving_object = dynamic_cast (&other); @@ -107,7 +113,7 @@ Rock::grab(MovingObject& , const Vector& pos, Direction) { movement = pos - get_pos(); last_movement = movement; - set_group(COLGROUP_DISABLED); + set_group(COLGROUP_TOUCHABLE); on_ground = true; grabbed = true; }