--- /dev/null
+(supertux-sprite
+
+ (action
+ (name "ticking-left")
+ (fps 4.0)
+ (hitbox 7 23 38 43)
+ (images cherrybomb_hit_1.png
+cherrybomb_hit_2.png
+cherrybomb_hit_3.png
+cherrybomb_hit_4.png
+cherrybomb_hit_5.png
+))
+
+ (action
+ (name "ticking-right")
+ (fps 4.0)
+ (hitbox 7 23 38 43)
+ (mirror-action "ticking-left"))
+
+ (action
+ (name "explosion")
+ (fps 5.0)
+ (hitbox 32 32 31.8 31.8)
+ (images sparkle-1.png
+sparkle-2.png
+sparkle-3.png
+sparkle-4.png
+sparkle-5.png
+))
+)
+
--- /dev/null
+(supertux-sprite
+ (action
+ (name "left")
+ (fps 10.0)
+ (hitbox 7 23 38 43)
+ (images "cherrybomb.png"
+ "cherrybomb1.png"
+ "cherrybomb2.png"
+ "cherrybomb3.png"
+ "cherrybomb4.png"
+ "cherrybomb5.png"
+
+))
+
+ (action
+ (name "right")
+ (fps 10.0)
+ (hitbox 7 23 38 43)
+ (mirror-action "left"))
+
+)
--- /dev/null
+(supertux-sprite
+ (action
+ (name "default")
+(fps 4.0)
+ (images
+ "bark-0.png"
+ )
+ )
+)
--- /dev/null
+(supertux-sprite
+ (action
+ (name "default")
+(fps 4.0)
+ (images
+ "kracker-1.png"
+ "kracker-2.png"
+"kracker-3.png"
+"kracker-4.png"
+"kracker-5.png"
+"kracker-6.png"
+"kracker-7.png"
+"kracker-8.png"
+"kracker-9.png"
+
+ )
+ )
+)
--- /dev/null
+(supertux-sprite
+ (action
+ (name "default")
+ (images
+ "kracker-1.png"
+ "kracker-2.png"
+"kracker-3.png"
+"kracker-4.png"
+"kracker-5.png"
+"kracker-6.png"
+"kracker-7.png"
+"kracker-8.png"
+"kracker-9.png"
+
+ )
+ )
+)
--- /dev/null
+(supertux-sprite
+ (action
+ (name "default")
+ (images
+ "kracker-1.png"
+
+ )
+ )
+)
--- /dev/null
+(supertux-sprite
+ (action
+ (name "default")
+ (images
+ "kracker-1.png"
+
+ )
+ )
+)
--- /dev/null
+(supertux-sprite
+ (action
+ (name "default")
+(fps 4.0)
+ (images
+ "leaf-0.png"
+ )
+ )
+)
--- /dev/null
+(supertux-sprite
+ (action
+ (name "default")
+(fps 4.0)
+ (images
+ "leaf-0.png"
+ )
+ )
+)
--- /dev/null
+(supertux-sprite
+ (action
+ (name "default")
+(fps 4.0)
+ (images
+ "poisonivy-0.png"
+"poisonivy-1.png"
+"poisonivy-2.png"
+"poisonivy-3.png"
+ )
+ )
+)
--- /dev/null
+(supertux-sprite
+ (action
+ (name "default")
+(fps 4.0)
+ (images
+ "poisonivy-0.png"
+ )
+ )
+)
--- /dev/null
+(supertux-sprite
+ (action
+ (name "default")
+(fps 4.0)
+ (images
+ "reset.png"
+
+ )
+ )
+)
--- /dev/null
+(supertux-sprite
+ (action
+ (name "default")
+(fps 4.0)
+ (images
+ "cloud.png"
+
+ )
+ )
+)
(sector
(name "main")
(music "music/forest2.ogg")
+ (mrbomb
+ (direction "auto")
+ (x 370.397)
+ (y 503.8701)
+ )
+ (mrbomb
+ (direction "auto")
+ (x 257.2599)
+ (y 503.8701)
+ )
(firefly
(x 429.1299)
(y 344.6518)
static const float EXPLOSIONTIME = 1;
Bomb::Bomb(const Vector& pos, Direction dir)
- : BadGuy(pos, "images/creatures/mr_bomb/bomb.sprite")
+ : BadGuy(pos, "images/creatures/mr_cherry/cherry.sprite")
{
state = STATE_TICKING;
timer.start(TICKINGTIME);
sprite->set_action(dir == LEFT ? "ticking-left" : "ticking-right");
countMe = false;
- ticking.reset(sound_manager->create_sound_source("sounds/ticking.wav"));
+ ticking.reset(sound_manager->create_sound_source("sounds/fizz.wav"));
ticking->set_position(get_pos());
ticking->set_looping(true);
ticking->set_gain(2.0);
: BadGuy(other), state(other.state), timer(other.timer)
{
if (state == STATE_TICKING) {
- ticking.reset(sound_manager->create_sound_source("sounds/ticking.wav"));
+ ticking.reset(sound_manager->create_sound_source("sounds/fizz.wav"));
ticking->set_position(get_pos());
ticking->set_looping(true);
ticking->set_gain(2.0);
sound_manager->play("sounds/explosion.wav", get_pos());
timer.start(EXPLOSIONTIME);
- // spawn some particles
- // TODO: provide convenience function in MovingSprite or MovingObject?
- for (int i = 0; i < 100; i++) {
- Vector ppos = bbox.get_middle();
- float angle = systemRandom.randf(-M_PI_2, M_PI_2);
- float velocity = systemRandom.randf(450, 900);
- float vx = sin(angle)*velocity;
- float vy = -cos(angle)*velocity;
- Vector pspeed = Vector(vx, vy);
- Vector paccel = Vector(0, 1000);
- Sector::current()->add_object(new SpriteParticle("images/objects/particles/smoke.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS-1));
- }
+// spawn some particles
+ // TODO: provide convenience function in MovingSprite or MovingObject?
+ for (int i = 0; i < 100; i++) {
+ Vector ppos = bbox.get_middle();
+ float angle = systemRandom.randf(-M_PI_2, M_PI_2);
+ float velocity = systemRandom.randf(450, 900);
+ float vx = sin(angle)*velocity;
+ float vy = -cos(angle)*velocity;
+ Vector pspeed = Vector(vx, vy);
+ Vector paccel = Vector(0, 1000);
+ Sector::current()->add_object(new SpriteParticle("images/objects/particles/kracker.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS-1));
+ }
}
static const float WALKSPEED = 80;
MrBomb::MrBomb(const lisp::Lisp& reader)
- : BadGuy(reader, "images/creatures/mr_bomb/mr_bomb.sprite")
+ : BadGuy(reader, "images/creatures/mr_cherry/mr_cherry.sprite")
{
set_direction = false;
reader.get("direction", direction);
}
MrBomb::MrBomb(const Vector& pos, Direction d)
- : BadGuy(pos, "images/creatures/mr_bomb/mr_bomb.sprite")
+ : BadGuy(pos, "images/creatures/mr_cherry/mr_cherry.sprite")
{
set_direction = true;
initial_direction = d;
#include "mrtree.hpp"
#include "poisonivy.hpp"
+#include "random_generator.hpp"
+#include "object/sprite_particle.hpp"
static const float WALKSPEED = 100;
static const float WALKSPEED_SMALL = 120;
sound_manager->play("sounds/mr_tree.ogg", get_pos());
player.bounce(*this);
-
+ // spawn some particles
+ // TODO: provide convenience function in MovingSprite or MovingObject?
+ for (int i = 0; i < 25; i++) {
+ Vector ppos = bbox.get_middle();
+ float angle = systemRandom.randf(-M_PI_2, M_PI_2);
+ float velocity = systemRandom.randf(45, 90);
+ float vx = sin(angle)*velocity;
+ float vy = -cos(angle)*velocity;
+ Vector pspeed = Vector(vx, vy);
+ Vector paccel = Vector(0, 100);
+ Sector::current()->add_object(new SpriteParticle("images/objects/particles/leaf.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS-1));
+ }
Vector leaf1_pos = Vector(pos.x - POISONIVY_WIDTH - 1, pos.y - POISONIVY_Y_OFFSET);
Rect leaf1_bbox = Rect(leaf1_pos.x, leaf1_pos.y, leaf1_pos.x + POISONIVY_WIDTH, leaf1_pos.y + POISONIVY_HEIGHT);
if (Sector::current()->is_free_space(leaf1_bbox)) {
sprite->set_action(dir == LEFT ? "squished-left" : "squished-right");
bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
kill_squished(player);
+ // spawn some particles
+ // TODO: provide convenience function in MovingSprite or MovingObject?
+ for (int i = 0; i < 25; i++) {
+ Vector ppos = bbox.get_middle();
+ float angle = systemRandom.randf(-M_PI_2, M_PI_2);
+ float velocity = systemRandom.randf(45, 90);
+ float vx = sin(angle)*velocity;
+ float vy = -cos(angle)*velocity;
+ Vector pspeed = Vector(vx, vy);
+ Vector paccel = Vector(0, 100);
+ Sector::current()->add_object(new SpriteParticle("images/objects/particles/bark.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS-1));
+ }
+
return true;
+
}
//TODO: exception?
#include <config.h>
#include "poisonivy.hpp"
+#include "random_generator.hpp"
+#include "object/sprite_particle.hpp"
static const float WALKSPEED = 80;
PoisonIvy::collision_squished(Player& player)
{
sprite->set_action(dir == LEFT ? "squished-left" : "squished-right");
+ // spawn some particles
+ // TODO: provide convenience function in MovingSprite or MovingObject?
+ for (int i = 0; i < 3; i++) {
+ Vector ppos = bbox.get_middle();
+ float angle = systemRandom.randf(-M_PI_2, M_PI_2);
+ float velocity = systemRandom.randf(350, 400);
+ float vx = sin(angle)*velocity;
+ float vy = -cos(angle)*velocity;
+ Vector pspeed = Vector(vx, vy);
+ Vector paccel = Vector(0, 100);
+ Sector::current()->add_object(new SpriteParticle("images/objects/particles/poisonivy.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS-1));
+ }
kill_squished(player);
return true;
}
#include "object_factory.hpp"
#include "game_session.hpp"
#include "sector.hpp"
+#include "random_generator.hpp"
+#include "object/sprite_particle.hpp"
Firefly::Firefly(const lisp::Lisp& lisp)
: MovingSprite(lisp, "images/objects/firefly/firefly.sprite", LAYER_TILES, COLGROUP_TOUCHABLE), activated(false)
Player* player = dynamic_cast<Player*> (&other);
if(player) {
activated = true;
+// spawn some particles
+// TODO: provide convenience function in MovingSprite or MovingObject?
+ for (int i = 0; i < 5; i++) {
+ Vector ppos = bbox.get_middle();
+ float angle = systemRandom.randf(-M_PI_2, M_PI_2);
+ float velocity = systemRandom.randf(450, 900);
+ float vx = sin(angle)*velocity;
+ float vy = -cos(angle)*velocity;
+ Vector pspeed = Vector(vx, vy);
+ Vector paccel = Vector(0, 1000);
+ Sector::current()->add_object(new SpriteParticle("images/objects/particles/reset.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS-1));
+ }
// TODO play sound
sprite->set_action("ringing");
GameSession::current()->set_reset_point(Sector::current()->get_name(),
#include "lisp/lisp.hpp"
#include "object/moving_sprite.hpp"
#include "serializable.hpp"
+#include "badguy/badguy.hpp"
/**
* A Firefly: When tux touches it, it begins buzzing and you will respawn at this