void
Flame::freeze()
{
- //TODO: get unique death sound
- sound_manager->play("sounds/fizz.wav", get_pos());
+ sound_manager->play("sounds/sizzle.ogg", get_pos());
sprite->set_action("fade", 1);
Sector::current()->add_object(new SpriteParticle("images/objects/particles/smoke.sprite", "default", bbox.get_middle(), ANCHOR_MIDDLE, Vector(0, -150), Vector(0,0), LAYER_BACKGROUNDTILES+2));
set_group(COLGROUP_DISABLED);
bbox.set_pos(Vector(start_position.x + cos(angle) * radius,
start_position.y + sin(angle) * radius));
countMe = false;
- //TODO: get unique death sound
- sound_manager->preload("sounds/fizz.wav");
+ sound_manager->preload("sounds/sizzle.ogg");
set_colgroup_active(COLGROUP_TOUCHABLE);
void
Iceflame::ignite()
{
- sound_manager->play("sounds/fizz.wav", get_pos());
+ sound_manager->play("sounds/sizzle.ogg", get_pos());
sprite->set_action("fade", 1);
Sector::current()->add_object(new SpriteParticle("images/objects/particles/smoke.sprite", "default", bbox.get_middle(), ANCHOR_MIDDLE, Vector(0, -150), Vector(0,0), LAYER_BACKGROUNDTILES+2));
set_group(COLGROUP_DISABLED);
max_drop_height = MAXDROPHEIGHT;
lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
lightsprite->set_color(Color(1.0f, 0.9f, 0.8f));
+ death_sound = "sounds/fall.wav";
}
void
state = STATE_WAKING;
}
}
-
- BadGuy::active_update(elapsed_time);
}
-
- if(state == STATE_WAKING) {
+ else if(state == STATE_WAKING) {
if(sprite->animation_done()) {
// start walking
state = STATE_WALKING;
WalkingBadguy::initialize();
}
-
- BadGuy::active_update(elapsed_time);
}
+
+ BadGuy::active_update(elapsed_time);
}
void
LiveFire::freeze()
{
// attempting to freeze a flame causes it to go out
+ death_sound = "sounds/sizzle.ogg";
kill_fall();
}
void
LiveFire::kill_fall()
{
- //TODO: get unique sound for ice-fire encounters
- sound_manager->play("sounds/fall.wav", get_pos());
+ sound_manager->play(death_sound, get_pos());
// throw a puff of smoke
Vector ppos = bbox.get_middle();
Vector pspeed = Vector(0, -150);
private:
SpritePtr lightsprite;
+ std::string death_sound;
protected:
enum SState {
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#include "audio/sound_manager.hpp"
#include "badguy/bomb.hpp"
#include "badguy/short_fuse.hpp"
#include "object/bullet.hpp"
walk_speed = 100;
max_drop_height = -1;
- //Prevent stutter when Tux jumps on Mr Bomb
- sound_manager->preload("sounds/explosion.wav");
-
//Check if we need another sprite
if( !reader.get( "sprite", sprite_name ) ){
return;
WalkingBadguy(reader, "images/creatures/snowman/snowman.sprite", "walk-left", "walk-right")
{
walk_speed = 40;
-}
-
-Snowman::Snowman(const Vector& pos, Direction d) :
- WalkingBadguy(pos, d, "images/creatures/snowman/snowman.sprite", "walk-left", "walk-right")
-{
- walk_speed = 40;
+ sound_manager->preload("sounds/pop.ogg");
}
void
// fire bullets destroy snowman's body
loose_head();
- // FIXME: the sound used here should differ since there is still a threat
- sound_manager->play("sounds/fall.wav", get_pos());
+ sound_manager->play("sounds/pop.ogg", get_pos()); // this could be a different sound
bullet.remove_me();
return ABORT_MOVE;
if (player)
player->bounce(*this);
- // FIXME: the squish sound isn't best here
- sound_manager->play("sounds/squish.wav", get_pos());
+ sound_manager->play("sounds/pop.ogg", get_pos());
loose_head();
#include "badguy/stalactite.hpp"
+#include "audio/sound_manager.hpp"
#include "math/random_generator.hpp"
#include "object/bullet.hpp"
#include "object/player.hpp"
{
countMe = false;
set_colgroup_active(COLGROUP_TOUCHABLE);
+ sound_manager->preload("sounds/cracking.wav");
+ sound_manager->preload("sounds/sizzle.ogg");
+ sound_manager->preload("sounds/icecrash.ogg");
}
void
&& player->get_bbox().p1.y < bbox.p2.y + SHAKE_RANGE_Y) {
timer.start(SHAKE_TIME);
state = STALACTITE_SHAKING;
+ sound_manager->play("sounds/cracking.wav", get_pos());
}
}
} else if(state == STALACTITE_SHAKING) {
physic.set_velocity_y(0);
set_state(STATE_SQUISHED);
sprite->set_action("squished");
+ sound_manager->play("sounds/icecrash.ogg", get_pos());
set_group(COLGROUP_MOVING_ONLY_STATIC);
run_dead_script();
}
timer.start(SHAKE_TIME);
state = STALACTITE_SHAKING;
bullet.remove_me();
+ if(bullet.get_type() == FIRE_BONUS)
+ sound_manager->play("sounds/sizzle.ogg", get_pos());
+ sound_manager->play("sounds/cracking.wav", get_pos());
}
return FORCE_MOVE;
lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-large.sprite"))
{
sound_manager->preload("sounds/explosion.wav");
+ sound_manager->preload("sounds/firecracker.ogg");
set_pos(get_pos() - (get_bbox().get_middle() - get_pos()));
lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
lightsprite->set_color(Color(0.6f, 0.6f, 0.6f));
lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-large.sprite"))
{
sound_manager->preload("sounds/explosion.wav");
+ sound_manager->preload("sounds/firecracker.ogg");
lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
lightsprite->set_color(Color(0.6f, 0.6f, 0.6f));
}
return;
state = STATE_EXPLODING;
- set_action("default", 1);
+ set_action("default", 1); //TODO: the less-threatening short_fuse explosion should look less-threatening
sprite->set_animation_loops(1); //TODO: this is necessary because set_action will not set "loops" when "action" is the default action
- sound_manager->play("sounds/explosion.wav", get_pos());
+ if (hurt)
+ sound_manager->play("sounds/explosion.wav", get_pos());
+ else
+ sound_manager->play("sounds/firecracker.ogg", get_pos());
+
#if 0
// spawn some particles
#include "object/weak_block.hpp"
+#include "audio/sound_manager.hpp"
#include "math/random_generator.hpp"
#include "object/bullet.hpp"
#include "object/explosion.hpp"
sprite->set_action("normal");
}
}
- lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
- lightsprite->set_color(Color(0.3f, 0.2f, 0.1f));
+ if(sprite_name == "images/objects/weak_block/strawbox.sprite") {
+ lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
+ lightsprite->set_color(Color(0.3f, 0.2f, 0.1f));
+ } else if(sprite_name == "images/objects/weak_block/meltbox.sprite")
+ sound_manager->preload("sounds/sizzle.ogg");
}
HitResponse
if (state != STATE_NORMAL) return;
state = STATE_BURNING;
sprite->set_action("burning", 1);
+ if(sprite_name == "images/objects/weak_block/meltbox.sprite")
+ sound_manager->play("sounds/sizzle.ogg");
}
void