-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.h
39 lines (36 loc) · 826 Bytes
/
Game.h
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
#pragma once
#include "Keyboard.h"
#include "Mouse.h"
#include "Graphics.h"
#include "Board.h"
#include "Snake.h"
#include "Goal.h"
#include <random>
class Game
{
public:
Game( class MainWindow& wnd );
Game( const Game& ) = delete;
Game& operator=( const Game& ) = delete;
void Go();
private:
void ComposeFrame();
void UpdateModel();
/********************************/
/* User Functions */
/********************************/
private:
MainWindow& wnd;
Graphics gfx;
/********************************/
/* User Variables */
/********************************/
Board brd;
Snake snek;
Location delta_loc = { 1,0 };
std::mt19937 rng;
Goal goal;
static constexpr int snekMovePeriod = 20;
int snekMoveCounter = 0;
bool gameIsOver = false;
};