#include <QGraphicsRectItem>
#include "PlaygroundScene.h"
+#include <robodim.h>
PlaygroundScene::PlaygroundScene(QObject *parent)
: QGraphicsScene(parent)
tempRect = addRect(QRect(2500, 1600, 500, 500), QPen(NoPen), QBrush(red));
tempRect->setZValue(3);
+ /* free pucks */
+ for (int x=0; x<PUCK_GRID_COLS_NUM; x++) {
+ for (int y=0; y<PUCK_GRID_ROWS_NUM; y++) {
+ QGraphicsEllipseItem *puck;
+ struct puck_pos p = free_puck_pos(x, y);
+ printf("%g %g\n", p.x, p.y);
+ puck = addEllipse(1000*p.x, 1000*p.y, 70, 70);
+ puck->setZValue(3);
+ puck = addEllipse(1000*(3-p.x), 1000*p.y, 70, 70);
+ puck->setZValue(3);
+ }
+ }
+
+ /* dispenser */
+ addRect(QRect(289-40, 0, 80, 80))->setZValue(3);
+ addRect(QRect(3000-(289-40), 0, 80, 80))->setZValue(3);
+
QBrush brownBrush = QBrush(QColor(202, 98, 9));
/* circular building area */
QGraphicsItemGroup *map;
QGraphicsRectItem *rects[MAP_WIDTH][MAP_HEIGHT]; // This must be slow - convert to pixmap. -- M.S.
QGraphicsEllipseItem *obstacle;
+ QGraphicsItemGroup *freePucks;
public slots:
void showObstacle(int val);