summaryrefslogtreecommitdiffstats
path: root/pacman-c++/block.cpp
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-04-25 14:39:00 +0200
committermanuel <manuel@mausz.at>2011-04-25 14:39:00 +0200
commit41a31420cf091aeb4e986503387855d41e550106 (patch)
treeffbe0be5f9630a0bab2deb0b5df37c174bf40db1 /pacman-c++/block.cpp
parentbbd2a69a962d15f74a4afcb7b66462eac9fa5008 (diff)
downloadfoop-41a31420cf091aeb4e986503387855d41e550106.tar.gz
foop-41a31420cf091aeb4e986503387855d41e550106.tar.bz2
foop-41a31420cf091aeb4e986503387855d41e550106.zip
- add intro sound on every round
- add dieing sound - add dieing animation - add die on moving onto colorized block
Diffstat (limited to 'pacman-c++/block.cpp')
-rw-r--r--pacman-c++/block.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/pacman-c++/block.cpp b/pacman-c++/block.cpp
index 68dd735..7f9dd14 100644
--- a/pacman-c++/block.cpp
+++ b/pacman-c++/block.cpp
@@ -36,18 +36,21 @@ void Block::setNeighbours(unsigned int neighbours)
36 setSprite(neighbours * Constants::sprite_offset, 0, Constants::field_size.width, Constants::field_size.height); 36 setSprite(neighbours * Constants::sprite_offset, 0, Constants::field_size.width, Constants::field_size.height);
37} 37}
38 38
39bool Block::checkEnter(Actor *actor) 39bool Block::checkEnter(Actor * /* actor */)
40{ 40{
41 if (m_color == Color::none) 41 if (m_color == Color::none)
42 return false; 42 return false;
43 return (m_color == actor->color()); 43 return true;
44} 44}
45 45
46bool Block::enter(Actor *actor) 46GameEntity::EnteredState Block::enter(Actor *actor)
47{ 47{
48 if (m_color != actor->color()) 48 if (m_color != Color::none && m_color != actor->color())
49 { 49 return DestroyedActor;
50 //TODO: actor dies + game ends 50 return Nothing;
51 } 51}
52 return true; 52
53void Block::onDie(Actor *actor)
54{
55 actor->die();
53} 56}