88 void DrawSprites( RenderWindow& window, Sprite& sprite1, Sprite& sprite2 );
94 void PlaySnake( RenderWindow& window, Sprite& sprite1, Sprite& sprite2 );
int m_direction
Direction of the snake.
const int WIDTH
Define width of the window.
virtual int CalculateScore()
Pure virtual function inherited from GameGenerics.h Each game calculate scores differently and theref...
int m_Score
Track game score.
void MoveSnake()
Move Snake across the grid per Tick.
const int N
Define length with 30 squares.
void PlaySnake(RenderWindow &window, Sprite &sprite1, Sprite &sprite2)
Start the game.
void GameOverLogic()
Whenever snake tries to eat itself game is over.
void KeyControls()
Allow user to control snake by using arrow keys.
void BoundaryControl()
If snake cross the boundary of the window make it reappear on the opposite side of the window.
SnakeStrct m_MySnake[100]
Holds x and y cordinates of the fruit.
void InitializeVars()
Create Sprites. Load the Images and set the Sprites. Call PlaySnake() function to start the game.
int m_SnakeLength
Length of the snake.
void MoveToThisDirection()
Set the direction to move the snake. 0 indicates down. 3 indicates up. 1 indicates left....
Snake()
Default Constructor. initialize variables.
const int HEIGHT
Define height of the window.
void GrowUponEat()
Whenever snake eats a fruit make it grow by 1 square.
const int SIZE
Define space between each square.
void DrawSprites(RenderWindow &window, Sprite &sprite1, Sprite &sprite2)
Draw sprites on the window.
bool m_IsGameOver
Track when game is over or not.
Fruit m_MyFruit
Holds x and y cordinates of the snake when it move across the grid.
const int M
Define height with 30 squares.
Structure to holds x and y cordinates of the fruit.
Structure to holds x and y cordinates of the snake when it move across the grid.