diff options
| author | manuel <manuel@mausz.at> | 2011-05-05 00:57:07 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-05-05 00:57:07 +0200 |
| commit | ce48af53646cd9e7ec762fc1ac176b3aa620b11d (patch) | |
| tree | f8fbf2cae8c7d0cbac2696a8f4cf94410bfb4928 /pacman-c++/common/point.cpp | |
| parent | e54ccad07e256ba877bd41d70bd358bd0085bd1e (diff) | |
| download | foop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.tar.gz foop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.tar.bz2 foop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.zip | |
- refactorized the whole project and made a few subprojects
- replaced tcp with enet
- added connect dialog
- some smaller bugfixes
Diffstat (limited to 'pacman-c++/common/point.cpp')
| -rw-r--r-- | pacman-c++/common/point.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/pacman-c++/common/point.cpp b/pacman-c++/common/point.cpp new file mode 100644 index 0000000..d7ebdb1 --- /dev/null +++ b/pacman-c++/common/point.cpp | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | #include "point.h" | ||
| 2 | #include "constants.h" | ||
| 3 | #include "actor.h" | ||
| 4 | |||
| 5 | namespace | ||
| 6 | { | ||
| 7 | QPixmap *pixmap = NULL; | ||
| 8 | } | ||
| 9 | |||
| 10 | Point::Point(QGraphicsItem *parent) | ||
| 11 | : GameEntity(parent) | ||
| 12 | { | ||
| 13 | m_type = Type; | ||
| 14 | |||
| 15 | /* empty object for servers */ | ||
| 16 | if (Constants::server) | ||
| 17 | return; | ||
| 18 | |||
| 19 | if (pixmap == NULL) | ||
| 20 | pixmap = new QPixmap(":/points"); | ||
| 21 | setPixmap(*pixmap); | ||
| 22 | } | ||
| 23 | |||
| 24 | GameEntity::EnteredState Point::enter(Actor *actor) | ||
| 25 | { | ||
| 26 | actor->addRoundPoints(Constants::Game::point_value); | ||
| 27 | return DestroyedEntity; | ||
| 28 | } | ||
| 29 | |||
| 30 | void Point::onDie(Actor *actor) | ||
| 31 | { | ||
| 32 | actor->startEating(); | ||
| 33 | } | ||
