Ejemplo n.º 1
0
GameScene::GameScene(const World& world)
    : animTicker()
    , portal(new QGraphicsPixmapItem(QPixmap(":/portal.png")))
{
    hover = this->addRect(0, 0,
                          tile_width, tile_height,
                          QColor(255, 64, 255),
                          QColor(128,128,255,64));
    hover->setZValue(100);

    player = this->addEllipse(0,
                              0,
                               20, 20,
                               QColor(255, 0, 0),
                               QColor(128, 32, 32));
    player->setZValue(99);
    this->player->setPos(worldToScreen(world.playerPosition));

    animTicker.setInterval(10);
    animTicker.start();
    connect(&animTicker, SIGNAL(timeout()), this, SLOT(refreshAnimations()));

    portal->setPos(worldToScreen(QPoint(world.landscape.width - 22,
                                        world.landscape.height - 18)));
    portal->setZValue(50);
    this->addItem(portal);

}
Ejemplo n.º 2
0
VOID setAccuracyIndicator(DOUBLE value)
{
	refreshAnimations();
	killAnimator(&global.accuracyIndicator);
	aniAdd(&global.accuracyIndicator, value, 150, ANIMATION::SINE);
}