summaryrefslogtreecommitdiffstats
path: root/pacman-c++/block.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pacman-c++/block.cpp')
-rw-r--r--pacman-c++/block.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/pacman-c++/block.cpp b/pacman-c++/block.cpp
index 083b203..c6aaa73 100644
--- a/pacman-c++/block.cpp
+++ b/pacman-c++/block.cpp
@@ -1,5 +1,6 @@
1#include "block.h" 1#include "block.h"
2#include "constants.h" 2#include "constants.h"
3#include "actor.h"
3#include <QtDebug> 4#include <QtDebug>
4 5
5QMap<Color::Color, QPixmap> Block::m_pixmaps; 6QMap<Color::Color, QPixmap> Block::m_pixmaps;
@@ -25,3 +26,17 @@ void Block::setNeighbours(unsigned int neighbours)
25{ 26{
26 setSprite(neighbours * Constants::sprite_offset, 0, Constants::field_size.width, Constants::field_size.height); 27 setSprite(neighbours * Constants::sprite_offset, 0, Constants::field_size.width, Constants::field_size.height);
27} 28}
29
30bool Block::checkEnter(Actor * /* actor */)
31{
32 return (m_color != Color::none);
33}
34
35bool Block::enter(Actor *actor)
36{
37 if (m_color != actor->color())
38 {
39 //TODO: actor dies + game ends
40 }
41 return true;
42}