Added MatzeB's drafts of World2 boss, the ghost tree.
SVN-Revision: 5019
--- /dev/null
+(supertux-sprite
+ (action
+ (name "default")
+ (images
+ "ghosttree.png"
+ )
+ )
+)
--- /dev/null
+(supertux-sprite
+ (action
+ (name "default")
+ (images "root.png")
+ )
+)
(hitbox 16 8 34 41)
(images "lantern-off.png")
)
+ (action
+ (name "off-open")
+ (hitbox 16 8 34 41)
+ (images "lantern-off-open.png")
+ )
)
--- /dev/null
+(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 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 (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 "Background")
+ (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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 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 1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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
+ )
+ )
+ (willowisp
+ (sector "main")
+ (spawnpoint "main")
+ (x 736)
+ (y 32)
+ )
+ )
+)
}
void
-BadGuy::save(lisp::Writer& )
+BadGuy::write(lisp::Writer& )
{
log_warning << "tried to write out a generic badguy" << std::endl;
}
/** 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.
--- /dev/null
+// $Id$
+//
+// SuperTux - Boss "GhostTree"
+// Copyright (C) 2007 Matthias Braun <matze@braunis.de>
+//
+// 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 <config.h>
+
+#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");
+
--- /dev/null
+// $Id$
+//
+// SuperTux - Boss "GhostTree"
+// Copyright (C) 2007 Matthias Braun <matze@braunis.de>
+//
+// 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
+
--- /dev/null
+// $Id$
+//
+// SuperTux - "Will-O-Wisp" Badguy
+// Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
+//
+// 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 <config.h>
+
+#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";
+}
+
--- /dev/null
+// $Id$
+//
+// SuperTux - Boss "GhostTree"
+// Copyright (C) 2007 Matthias Braun <matze@braunis.de>
+//
+// 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
--- /dev/null
+// $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 <config.h>
+
+#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<Lantern*>(&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;
+}
+
--- /dev/null
+// $Id$
+//
+// SuperTux - "Will-O-Wisp" Badguy
+// Copyright (C) 2007 Matthias Braun <matze@braunis.de>
+//
+// 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<SoundSource> sound_source;
+};
+
+#endif
+
#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 */
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());
}
}
if (mystate == STATE_VANISHING) {
+ Vector dir = dist.unit();
+ movement = dir*elapsed_time*FLYSPEED;
if(sprite->animation_done()) {
remove_me();
}
{
}
+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<Lantern*>(&other)) return true;
+ if (dynamic_cast<Player*>(&other)) return true;
+ return false;
+}
+
HitResponse
WillOWisp::collision_player(Player& player, const CollisionHit& ) {
if(player.is_invincible()) return ABORT_MOVE;
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:
{
(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 */
#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"),
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<WillOWisp*>(&other);
+ if (wow) {
+ // collided with WillOWisp while grabbed and unlit
+ lightcolor = Color(0,1,0);
+ updateColor();
+ wow->vanish();
+ }
+ TreeWillOWisp* twow = dynamic_cast<TreeWillOWisp*>(&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");
+
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;
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)
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<MovingObject*> (&other);
{
movement = pos - get_pos();
last_movement = movement;
- set_group(COLGROUP_DISABLED);
+ set_group(COLGROUP_TOUCHABLE);
on_ground = true;
grabbed = true;
}