-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSnake.h
More file actions
61 lines (55 loc) · 1.61 KB
/
Snake.h
File metadata and controls
61 lines (55 loc) · 1.61 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
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once
#include <afxwin.h> // CButton, CString
#include "resource.h"
#include <utility>
constexpr int GRIDSIZE = 50;
typedef std::pair<int, int> IntPair;
enum class EDIFFICULTY
{
UNINIT = 200,
EASY = 150,
MEDIUM = 100,
HARD = 50
};
//************************************
// Plays SNAKE.wav (snakejazz)
// only when the parameter bPlay is true
// If the parameter is false, stops the music
// The sound mode must be enabled, otherwise
// the music stops too
//
// Method: PlaySnakeJazz
// FullName: PlaySnakeJazz
// Access: public
// Returns: void
// Qualifier:
// Parameter: const bool bPlay
//************************************
void PlaySnakeJazz(const bool bPlay);
//************************************
// Translates a gamesize (int) into
// screensize by multiplying by factor (8)
//
// Method: TranslateGameToDisplay
// FullName: TranslateGameToDisplay
// Access: public constexpr
// Returns: int
// Qualifier:
// Parameter: const int iGameSize
//************************************
constexpr int TranslateGameToDisplay(const int iGameSize) { return 8 * iGameSize; }
//************************************
// Translate game coordinates into
// Display coordinates by translating
// the individual coordinates
// using the static function
// TranslateGameToDisplay(const int iGameSize)
//
// Method: TranslateGameToDisplay
// FullName: TranslateGameToDisplay
// Access: public constexpr
// Returns: IntPair
// Qualifier:
// Parameter: const IntPair Coordinates
//************************************
constexpr IntPair TranslateGameToDisplay(const IntPair Coordinates);