start_dir(AUTO),
frozen(false),
ignited(false),
+ in_water(false),
dead_script(),
state(STATE_INIT),
is_active_flag(),
SoundManager::current()->preload("sounds/squish.wav");
SoundManager::current()->preload("sounds/fall.wav");
+ SoundManager::current()->preload("sounds/splash.ogg");
dir = (start_dir == AUTO) ? LEFT : start_dir;
}
SoundManager::current()->preload("sounds/squish.wav");
SoundManager::current()->preload("sounds/fall.wav");
+ SoundManager::current()->preload("sounds/splash.ogg");
dir = (start_dir == AUTO) ? LEFT : start_dir;
}
SoundManager::current()->preload("sounds/squish.wav");
SoundManager::current()->preload("sounds/fall.wav");
+ SoundManager::current()->preload("sounds/splash.ogg");
dir = (start_dir == AUTO) ? LEFT : start_dir;
}
// Don't kill badguys that have already been killed
if (!is_active()) return;
+ if(tile_attributes & Tile::WATER && !is_in_water())
+ {
+ in_water = true;
+ SoundManager::current()->play("sounds/splash.ogg", get_pos());
+ }
+ if(!(tile_attributes & Tile::WATER) && is_in_water())
+ {
+ in_water = false;
+ }
+
if(tile_attributes & Tile::HURTS) {
if (tile_attributes & Tile::FIRE) {
if (is_flammable()) ignite();
return frozen;
}
+bool
+BadGuy::is_in_water() const
+{
+ return in_water;
+}
+
void
BadGuy::ignite()
{
bool is_frozen() const;
+ bool is_in_water() const;
+
protected:
enum State {
STATE_INIT,
bool frozen;
bool ignited; /**< true if this badguy is currently on fire */
+ bool in_water; /** < true if the badguy is currently in water */
std::string dead_script; /**< script to execute when badguy is killed */