summaryrefslogtreecommitdiffstats
path: root/pacman-c++/common/point.cpp
blob: d7ebdb158550990499d70c98a9669a4dcc8668ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "point.h"
#include "constants.h"
#include "actor.h"

namespace
{
  QPixmap *pixmap = NULL;
}

Point::Point(QGraphicsItem *parent)
  : GameEntity(parent)
{
  m_type = Type;

  /* empty object for servers */
  if (Constants::server)
    return;

  if (pixmap == NULL)
    pixmap = new QPixmap(":/points");
  setPixmap(*pixmap);
}

GameEntity::EnteredState Point::enter(Actor *actor)
{
  actor->addRoundPoints(Constants::Game::point_value);
  return DestroyedEntity;
}

void Point::onDie(Actor *actor)
{
  actor->startEating();
}