4
1
mirror of https://github.com/QuasarApp/Snake.git synced 2025-05-06 06:29:47 +00:00

21 lines
371 B
C++

#include "background.h"
BackGround::BackGround(double x, double y): ItemWorld (x, y) {
this->setSize(200, 400);
this->setTexture("qrc:/texture/asphalt");
setBeckGroundObject(true);
}
void BackGround::render() {
auto wPart = w() / 2;
if (m_x + wPart < 200) {
setX(wPart);
}
}
void BackGround::reset() {
setX(0 - w());
render();
}