diff options
| author | totycro <totycro@unknown-horizons.org> | 2011-04-11 12:09:04 +0200 |
|---|---|---|
| committer | totycro <totycro@unknown-horizons.org> | 2011-04-11 12:09:04 +0200 |
| commit | 98f4a31e1a359a69dbcc0fa4055f36cefb6d4e02 (patch) | |
| tree | ddd164d3339a067116f02f88314e2f57457bb1df /pacman-c++/bonuspoint.cpp | |
| parent | 30c36b7549f8ae411f8eca4de144627331895a24 (diff) | |
| download | foop-98f4a31e1a359a69dbcc0fa4055f36cefb6d4e02.tar.gz foop-98f4a31e1a359a69dbcc0fa4055f36cefb6d4e02.tar.bz2 foop-98f4a31e1a359a69dbcc0fa4055f36cefb6d4e02.zip | |
Added basic game logic
Diffstat (limited to 'pacman-c++/bonuspoint.cpp')
| -rw-r--r-- | pacman-c++/bonuspoint.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pacman-c++/bonuspoint.cpp b/pacman-c++/bonuspoint.cpp index eedb796..3a72243 100644 --- a/pacman-c++/bonuspoint.cpp +++ b/pacman-c++/bonuspoint.cpp | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | #include "bonuspoint.h" | 1 | #include "bonuspoint.h" |
| 2 | #include "constants.h" | 2 | #include "constants.h" |
| 3 | #include "actor.h" | ||
| 3 | 4 | ||
| 4 | #define BONUSPOINTS_NUM_SPRITES 4 | 5 | #define BONUSPOINTS_NUM_SPRITES 4 |
| 5 | 6 | ||
| @@ -18,3 +19,8 @@ BonusPoint::BonusPoint(QGraphicsItem *parent) | |||
| 18 | int rand = (int) (BONUSPOINTS_NUM_SPRITES * (qrand() / (RAND_MAX + 1.0))); | 19 | int rand = (int) (BONUSPOINTS_NUM_SPRITES * (qrand() / (RAND_MAX + 1.0))); |
| 19 | setSprite(rand * 20 + Constants::sprite_margin, Constants::sprite_margin, Constants::field_size.width, Constants::field_size.height); | 20 | setSprite(rand * 20 + Constants::sprite_margin, Constants::sprite_margin, Constants::field_size.width, Constants::field_size.height); |
| 20 | } | 21 | } |
| 22 | |||
| 23 | void BonusPoint::enter(Actor* actor) | ||
| 24 | { | ||
| 25 | actor->addRoundPoints(Constants::Game::bonus_point_value); | ||
| 26 | } | ||
