summaryrefslogtreecommitdiff
path: root/noncore/games/snake/snake.cpp
Side-by-side diff
Diffstat (limited to 'noncore/games/snake/snake.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/snake/snake.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/noncore/games/snake/snake.cpp b/noncore/games/snake/snake.cpp
index 9f19841..8a683ab 100644
--- a/noncore/games/snake/snake.cpp
+++ b/noncore/games/snake/snake.cpp
@@ -1,51 +1,49 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "snake.h"
#include "target.h"
-#include "codes.h"
#include <qpe/resource.h>
-#include <qregexp.h>
static int Piecekey[4][4] = { {6, 0, 4, 3 }, {0, 6, 2, 1 }, { 1, 3, 5, 0 }, {2, 4, 0, 5 } };
Snake::Snake(QCanvas* c)
{
canvas = c;
score = 0;
snakelist.setAutoDelete(true);
autoMoveTimer = new QTimer(this);
connect( autoMoveTimer, SIGNAL(timeout()), this, SLOT(moveSnake()) );
createSnake();
}
void Snake::createSnake()
{
snakeparts = new QCanvasPixmapArray();
QString s0 = Resource::findPixmap("snake/s0001");
s0.replace(QRegExp("0001"),"%1");
snakeparts->readPixmaps(s0, 15);
grow = 0;
last = Key_Right;
QCanvasSprite* head = new QCanvasSprite(snakeparts, canvas );