summaryrefslogtreecommitdiff
path: root/noncore/games/snake/interface.cpp
Unidiff
Diffstat (limited to 'noncore/games/snake/interface.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/snake/interface.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/games/snake/interface.cpp b/noncore/games/snake/interface.cpp
index 0f312ac..68e0f14 100644
--- a/noncore/games/snake/interface.cpp
+++ b/noncore/games/snake/interface.cpp
@@ -91,25 +91,25 @@ void SnakeGame::welcomescreen()
91 QCanvasPixmapArray* titlearray = new QCanvasPixmapArray(Resource::findPixmap("snake/title")); 91 QCanvasPixmapArray* titlearray = new QCanvasPixmapArray(Resource::findPixmap("snake/title"));
92 QCanvasSprite* titlepic = new QCanvasSprite(titlearray, &canvas); 92 QCanvasSprite* titlepic = new QCanvasSprite(titlearray, &canvas);
93 titlepic->move(canvas.width()/2 - 33, canvas.height()/2-85); 93 titlepic->move(canvas.width()/2 - 33, canvas.height()/2-85);
94 titlepic->show(); 94 titlepic->show();
95 QCanvasText* instr = new QCanvasText(tr("Use the arrow keys to guide the\n" 95 QCanvasText* instr = new QCanvasText(tr("Use the arrow keys to guide the\n"
96 "snake to eat the mouse. You must not\n" 96 "snake to eat the mouse. You must not\n"
97 "crash into the walls, edges or its tail."), 97 "crash into the walls, edges or its tail."),
98 &canvas); 98 &canvas);
99 w = instr->boundingRect().width(); 99 w = instr->boundingRect().width();
100 instr->move(canvas.width()/2-w/2, canvas.height()/2-20); 100 instr->move(canvas.width()/2-w/2, canvas.height()/2-20);
101 instr->setColor(white); 101 instr->setColor(white);
102 instr->show(); 102 instr->show();
103 QCanvasText* cont = new QCanvasText(tr("Press Any Key To Start"), &canvas); 103 QCanvasText* cont = new QCanvasText(tr("Press any key to start"), &canvas);
104 w = cont->boundingRect().width(); 104 w = cont->boundingRect().width();
105 cont->move(canvas.width()/2-w/2, canvas.height()-20); 105 cont->move(canvas.width()/2-w/2, canvas.height()-20);
106 cont->setColor(yellow); 106 cont->setColor(yellow);
107 cont->show(); 107 cont->show();
108 108
109} 109}
110 110
111void SnakeGame::newGame() 111void SnakeGame::newGame()
112{ 112{
113 clear(); 113 clear();
114 snake = new Snake(&canvas); 114 snake = new Snake(&canvas);
115 connect(snake, SIGNAL(dead()), this, SLOT(gameOver()) ); 115 connect(snake, SIGNAL(dead()), this, SLOT(gameOver()) );
@@ -187,25 +187,25 @@ void SnakeGame::gameOver()
187 int w = gameover->boundingRect().width(); 187 int w = gameover->boundingRect().width();
188 gameover->move(canvas.width()/2 -w/2, canvas.height()/2 -50); 188 gameover->move(canvas.width()/2 -w/2, canvas.height()/2 -50);
189 gameover->show(); 189 gameover->show();
190 gamestopped = true; 190 gamestopped = true;
191 waitover = false; 191 waitover = false;
192 pauseTimer->start(1500); 192 pauseTimer->start(1500);
193} 193}
194 194
195void SnakeGame::wait() 195void SnakeGame::wait()
196{ 196{
197 waitover = true; 197 waitover = true;
198 pauseTimer->stop(); 198 pauseTimer->stop();
199 QCanvasText* cont = new QCanvasText(tr("Press Any Key to Begin a New Game."), 199 QCanvasText* cont = new QCanvasText(tr("Press any key to begin a new game."),
200 &canvas); 200 &canvas);
201 cont->setZ(100); 201 cont->setZ(100);
202 cont->setColor(white); 202 cont->setColor(white);
203 int w = cont->boundingRect().width(); 203 int w = cont->boundingRect().width();
204 cont->move(canvas.width()/2 -w/2, canvas.height()/2); 204 cont->move(canvas.width()/2 -w/2, canvas.height()/2);
205 cont->show(); 205 cont->show();
206} 206}
207 207
208void SnakeGame::keyPressEvent(QKeyEvent* event) 208void SnakeGame::keyPressEvent(QKeyEvent* event)
209{ 209{
210 if (gamestopped) { 210 if (gamestopped) {
211 if (waitover) 211 if (waitover)