mirror of
https://github.com/QuasarApp/Snake.git
synced 2025-04-28 02:34:44 +00:00
20 lines
416 B
C++
20 lines
416 B
C++
|
#include "backgrounditem.h"
|
||
|
|
||
|
#include <QColor>
|
||
|
|
||
|
BackGroundItem::BackGroundItem(double x, double y):
|
||
|
ItemWorld (x, y) {
|
||
|
setBeckGroundObject(true);
|
||
|
reset();
|
||
|
}
|
||
|
|
||
|
void BackGroundItem::reset() {
|
||
|
auto tempColor = QColor(rand() % 255, rand() % 255, rand() % 255, 10);
|
||
|
setColor(tempColor.name(QColor::HexArgb));
|
||
|
auto radius = rand() % 200;
|
||
|
setSize(radius , radius);
|
||
|
|
||
|
setRadius(radius / 2);
|
||
|
|
||
|
}
|