game.h
1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
class Game
{
private:
int debounce( int last, int buttonPin );
void playNote( int note, int noteSpeed ) const;
void flashLed( int led, int flashSpeed ) const;
void initPins();
public:
static const int RED_PIN;
static const int BLUE_PIN;
static const int GREEN_PIN;
static const int YELLOW_PIN;
static const int MICROPHONE_PIN;
static const int RED_BUTTON_PIN;
static const int BLUE_BUTTON_PIN;
static const int GREEN_BUTTON_PIN;
static const int YELLOW_BUTTON_PIN;
static const int RED_TONE;
static const int BLUE_TONE;
static const int GREEN_TONE;
static const int YELLOW_TONE;
static const int GAMEOVER_TONE;
int gameLevel[200];
int gameSpeed;
int lastButtonValue;
int currentLevel;
int gameIsOver;
double gameDifficulty;
enum color { YELLOW, GREEN, RED, BLUE };
public:
Game();
Game(int)
~Game();
void playLevel();
int userInput();
int gameOver();
int getNote( int note ) const;
int pinToColorCode( int );
int colorCodeToPinn( int );
int readButton( int buttonPin );
};