rewrite chaingame
This commit is contained in:
@@ -5,6 +5,18 @@
|
||||
#include "buttons.h"
|
||||
#include "game.h"
|
||||
|
||||
#define PLAYNEXTTIMEOUT 3000 // 3sec * 1000ms
|
||||
|
||||
typedef enum
|
||||
{
|
||||
cg_idle,
|
||||
cg_play,
|
||||
cg_play_next,
|
||||
cg_cheat,
|
||||
cg_cheat_next,
|
||||
cg_reset
|
||||
} cg_states;
|
||||
|
||||
class c_chaingame : public c_game
|
||||
{
|
||||
private:
|
||||
@@ -14,11 +26,14 @@ private:
|
||||
bool cheatButtonFlag = false;
|
||||
uint16_t ledpattern[4] = {1, 3, 1, 2};
|
||||
int patternlength = sizeof(ledpattern) / sizeof(ledpattern[0]);
|
||||
cg_states state = cg_reset;
|
||||
uint32_t playNextTimer=0;
|
||||
|
||||
void nextPattern(void);
|
||||
void updateCheatButton(void);
|
||||
|
||||
public:
|
||||
c_chaingame(e_ledcolor gamecolor): c_game{chaingame, gamecolor} {}
|
||||
c_chaingame(e_ledcolor gamecolor) : c_game{chaingame, gamecolor} {}
|
||||
void runGame(void);
|
||||
bool initGame(void);
|
||||
void resetGame(void);
|
||||
@@ -27,5 +42,4 @@ public:
|
||||
// void HandleChainGame( bool newstate );
|
||||
// void ResetChainGame(void);
|
||||
|
||||
|
||||
#endif //CHAINGAMEH
|
||||
#endif // CHAINGAMEH
|
||||
Reference in New Issue
Block a user