6
#include "byogamebase.h"
13
class byoCBTris: public byoGameBase
17
byoCBTris(wxWindow* parent,const wxString& GameName);
21
static const int bricksHoriz = 15;
22
static const int bricksMargin = 5;
23
static const int bricksVert = 30;
25
typedef int ChunkConfig[16];
27
void OnPaint(wxPaintEvent& event);
28
void OnKeyDown(wxKeyEvent& event);
29
void OnKeyUp(wxKeyEvent& event);
30
void OnSpeedTimer(wxTimerEvent& event);
31
void OnLeftRightTimer(wxTimerEvent& event);
32
void OnUpTimer(wxTimerEvent& event);
33
void OnDownTimer(wxTimerEvent& event);
34
void OnEraseBack(wxEraseEvent& event);
35
void OnKillFocus(wxFocusEvent& event);
37
void DrawBrickField(wxDC* DC);
38
void DrawCurrentChunk(wxDC* DC);
39
void DrawNextChunk(wxDC* DC);
41
void RandomizeChunk(ChunkConfig& chunk,int color=-1);
42
void RotateChunkLeft(const ChunkConfig& chunk,ChunkConfig& newChunk);
43
void RotateChunkRight(const ChunkConfig& chunk,ChunkConfig& newChunk);
44
void AlignChunk(ChunkConfig& chunk);
45
bool CheckChunkColision(const ChunkConfig& chunk,int posX,int posY);
48
void RemoveFullLines();
49
bool GenerateNewChunk();
51
void UpdateChunkPosLeftRight();
52
void UpdateChunkPosUp();
53
void UpdateChunkPosDown();
54
void DrawStats(wxDC* DC);
55
void AddRemovedLines(int removed);
56
void StartTimerNow(wxTimer& timer);
57
int GetScoreScale() const;
60
wxTimer LeftRightTimer;
71
int m_TotalRemovedLines;
75
// Font used inside game
78
int m_Content[bricksHoriz][bricksVert];
80
ChunkConfig m_CurrentChunk;
83
ChunkConfig m_NextChunk;