projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set countMe flag to false for headless snomen
[supertux.git]
/
src
/
badguy
/
snowman.cpp
diff --git
a/src/badguy/snowman.cpp
b/src/badguy/snowman.cpp
index
5cbd5c7
..
6170ae1
100644
(file)
--- a/
src/badguy/snowman.cpp
+++ b/
src/badguy/snowman.cpp
@@
-1,5
+1,5
@@
// SuperTux
// SuperTux
-// Copyright (C) 2010 Ingo Ruhnke <grumbel@gm
x.de
>
+// Copyright (C) 2010 Ingo Ruhnke <grumbel@gm
ail.com
>
//
// 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
//
// 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
@@
-26,12
+26,7
@@
Snowman::Snowman(const Reader& reader) :
WalkingBadguy(reader, "images/creatures/snowman/snowman.sprite", "walk-left", "walk-right")
{
walk_speed = 40;
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;
+ SoundManager::current()->preload("sounds/pop.ogg");
}
void
}
void
@@
-50,9
+45,10
@@
Snowman::loose_head()
physic.set_acceleration_y(0);
physic.enable_gravity(true);
set_state (STATE_FALLING);
physic.set_acceleration_y(0);
physic.enable_gravity(true);
set_state (STATE_FALLING);
+ countMe = false;
/* Create a new snowball where the snowman's head was */
/* Create a new snowball where the snowman's head was */
-
SnowBall* snowball = new SnowBall
(snowball_pos, dir, dead_script);
+
auto snowball = std::make_shared<SnowBall>
(snowball_pos, dir, dead_script);
Sector::current()->add_object(snowball);
}
Sector::current()->add_object(snowball);
}
@@
-63,8
+59,7
@@
Snowman::collision_bullet(Bullet& bullet, const CollisionHit& hit)
// fire bullets destroy snowman's body
loose_head();
// 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());
+ SoundManager::current()->play("sounds/pop.ogg", get_pos()); // this could be a different sound
bullet.remove_me();
return ABORT_MOVE;
bullet.remove_me();
return ABORT_MOVE;
@@
-84,8
+79,7
@@
Snowman::collision_squished(GameObject& object)
if (player)
player->bounce(*this);
if (player)
player->bounce(*this);
- // FIXME: the squish sound isn't best here
- sound_manager->play("sounds/squish.wav", get_pos());
+ SoundManager::current()->play("sounds/pop.ogg", get_pos());
loose_head();
loose_head();