Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

SnakeGame Class Reference

#include </home/clem/local/src/opie/noncore/games/snake/interface.h>

Collaboration diagram for SnakeGame:

Collaboration graph
[legend]
List of all members.

Signals

void moveFaster ()

Public Member Functions

 SnakeGame (QWidget *parent=0, const char *name=0, WFlags f=0)
 ~SnakeGame ()
void clear ()
void createTargets ()

Static Public Member Functions

static QString appName ()

Protected Member Functions

virtual void keyPressEvent (QKeyEvent *)
virtual void resizeEvent (QResizeEvent *e)

Private Slots

void newGame ()
void gameOver ()
void wait ()
void levelUp ()
void scoreInc ()
void welcomescreen ()

Private Member Functions

void showScore (int)

Private Attributes

QCanvasView * cv
QLabel * scorelabel
QCanvas canvas
QTimer * pauseTimer
Snakesnake
int last
int level
int stage
int targetamount
int notargets
bool waitover
bool gamestopped

Constructor & Destructor Documentation

SnakeGame::SnakeGame QWidget *  parent = 0,
const char *  name = 0,
WFlags  f = 0
 

Definition at line 28 of file interface.cpp.

References QPEApplication::AlwaysOff, canvas, cv, FALSE, gamestopped, Opie::Core::OResource::loadPixmap(), newGame(), pauseTimer, scorelabel, QPEApplication::setInputMethodHint(), showScore(), snake, tr, TRUE, wait(), waitover, and welcomescreen().

SnakeGame::~SnakeGame  ) 
 

Definition at line 69 of file interface.cpp.

References snake.


Member Function Documentation

static QString SnakeGame::appName  )  [inline, static]
 

Definition at line 41 of file interface.h.

References QString::fromLatin1().

void SnakeGame::clear  ) 
 

Definition at line 165 of file interface.cpp.

References canvas, l, and snake.

Referenced by newGame().

void SnakeGame::createTargets  ) 
 

Definition at line 158 of file interface.cpp.

References canvas, i, notargets, and targetamount.

Referenced by levelUp(), and newGame().

void SnakeGame::gameOver  )  [private, slot]
 

Definition at line 175 of file interface.cpp.

References canvas, gamestopped, Snake::getScore(), pauseTimer, QString::setNum(), snake, tr, and waitover.

Referenced by newGame().

void SnakeGame::keyPressEvent QKeyEvent *   )  [protected, virtual]
 

Definition at line 206 of file interface.cpp.

References gamestopped, Snake::go(), newGame(), snake, and waitover.

void SnakeGame::levelUp  )  [private, slot]
 

Definition at line 143 of file interface.cpp.

References createTargets(), level, moveFaster(), notargets, stage, and targetamount.

Referenced by newGame().

void SnakeGame::moveFaster  )  [signal]
 

Referenced by levelUp(), and newGame().

void SnakeGame::newGame  )  [private, slot]
 

Definition at line 109 of file interface.cpp.

References canvas, clear(), createTargets(), gameOver(), gamestopped, last, level, levelUp(), moveFaster(), notargets, scoreInc(), showScore(), snake, stage, targetamount, waitover, and Opie::MM::y.

Referenced by keyPressEvent(), and SnakeGame().

void SnakeGame::resizeEvent QResizeEvent *  e  )  [protected, virtual]
 

Definition at line 74 of file interface.cpp.

References canvas, and s.

void SnakeGame::scoreInc  )  [private, slot]
 

Definition at line 138 of file interface.cpp.

References Snake::getScore(), showScore(), and snake.

Referenced by newGame().

void SnakeGame::showScore int   )  [private]
 

Definition at line 132 of file interface.cpp.

References scorelabel, and tr.

Referenced by newGame(), scoreInc(), and SnakeGame().

void SnakeGame::wait  )  [private, slot]
 

Definition at line 193 of file interface.cpp.

References canvas, pauseTimer, tr, and waitover.

Referenced by SnakeGame().

void SnakeGame::welcomescreen  )  [private, slot]
 

Definition at line 81 of file interface.cpp.

References canvas, Opie::Core::OResource::findPixmap(), title, and tr.

Referenced by SnakeGame().


Member Data Documentation

QCanvas SnakeGame::canvas [private]
 

Definition at line 62 of file interface.h.

Referenced by clear(), createTargets(), gameOver(), newGame(), resizeEvent(), SnakeGame(), wait(), and welcomescreen().

QCanvasView* SnakeGame::cv [private]
 

Definition at line 60 of file interface.h.

Referenced by SnakeGame().

bool SnakeGame::gamestopped [private]
 

Definition at line 71 of file interface.h.

Referenced by gameOver(), keyPressEvent(), newGame(), and SnakeGame().

int SnakeGame::last [private]
 

Definition at line 65 of file interface.h.

Referenced by newGame().

int SnakeGame::level [private]
 

Definition at line 66 of file interface.h.

Referenced by levelUp(), and newGame().

int SnakeGame::notargets [private]
 

Definition at line 69 of file interface.h.

Referenced by createTargets(), levelUp(), and newGame().

QTimer* SnakeGame::pauseTimer [private]
 

Definition at line 63 of file interface.h.

Referenced by gameOver(), SnakeGame(), and wait().

QLabel* SnakeGame::scorelabel [private]
 

Definition at line 61 of file interface.h.

Referenced by showScore(), and SnakeGame().

Snake* SnakeGame::snake [private]
 

Definition at line 64 of file interface.h.

Referenced by clear(), gameOver(), keyPressEvent(), newGame(), scoreInc(), SnakeGame(), and ~SnakeGame().

int SnakeGame::stage [private]
 

Definition at line 67 of file interface.h.

Referenced by levelUp(), and newGame().

int SnakeGame::targetamount [private]
 

Definition at line 68 of file interface.h.

Referenced by createTargets(), levelUp(), and newGame().

bool SnakeGame::waitover [private]
 

Definition at line 70 of file interface.h.

Referenced by gameOver(), keyPressEvent(), newGame(), SnakeGame(), and wait().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:52:13 2005 for OPIE by  doxygen 1.4.2