cxWidgets 1.0
CentipedeGame.h
Go to the documentation of this file.
1#ifndef __CENTIPEDEGAME_H__
2#define __CENTIPEDEGAME_H__
3
4#include "../../src/cxWindow.h"
5#include "../../src/cxUtils.h"
6#include "../../src/cxKeyDefines.h"
7#include <vector>
8#include <list>
9
10struct Point {
11 int x, y;
12};
13
16 int dir; // 1 for right, -1 for left
18};
19
21public:
22 CentipedeGame(int pHeight, int pWidth);
23
24 void spawnMushroom();
25 void spawnCentipede(int length);
26 void draw();
27 bool isMushroomAt(int x, int y);
28 void removeMushroomAt(int x, int y);
29 void update();
30 void run();
31
32private:
33 Point mPlayerPos;
34 std::list<Point> mMushrooms;
35 std::list<Point> mBullets;
36 std::vector<CentipedeSegment> mCentipede;
37 bool mGameOver;
38 int mScore;
39};
40
41#endif
Definition CentipedeGame.h:20
void run()
Definition CentipedeGame.cpp:165
void draw()
Fills the member ncurses window structure with the current.
Definition CentipedeGame.cpp:46
bool isMushroomAt(int x, int y)
Definition CentipedeGame.cpp:81
void update()
Definition CentipedeGame.cpp:97
void spawnCentipede(int length)
Definition CentipedeGame.cpp:34
void removeMushroomAt(int x, int y)
Definition CentipedeGame.cpp:88
void spawnMushroom()
Definition CentipedeGame.cpp:25
Represents a text-based window on the screen. Can contain a title, status, and a message to appear wi...
Definition cxWindow.h:195
Definition CentipedeGame.h:14
bool descending
Definition CentipedeGame.h:17
Point pos
Definition CentipedeGame.h:15
int dir
Definition CentipedeGame.h:16
Definition CentipedeGame.h:10
int y
Definition CentipedeGame.h:11
int x
Definition CentipedeGame.h:11