-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOffroadMap.h
More file actions
56 lines (49 loc) · 1.28 KB
/
OffroadMap.h
File metadata and controls
56 lines (49 loc) · 1.28 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
#pragma once
#include "Map.h"
class OffroadMap : public virtual Map
{
public:
OffroadMap(int rows, int colls, Difficulty difficulty, Surface& screen);
void AddRow(bool empty = false) override;
void Move(float deltaTime) override;
void Draw() override;
private:
/// <summary>
/// Generates random tile based on its position in map
/// </summary>
/// <param name="column">- column in row</param>
/// <returns>Random tile</returns>
Tile GenerateTile(int column);
/// <summary>
/// Generates random object
/// </summary>
Tile::Objects_t GetRandomObject();
/// <summary>
/// Generate random powerup
/// </summary>
int GetRandomPowerup();
/// <summary>
/// Check if player collides with object
/// </summary>
/// <param name="x">- player X</param>
/// <param name="y">- player Y</param>
/// <returns>false if player hits an obstacle</returns>
bool CheckPos(int x, int y);
/// <summary>
/// Draw player
/// </summary>
void DrawPlayer();
/// <summary>
/// Print score on scoreboard
/// </summary>
void PrintScore();
/// <summary>
/// Print shield timer
/// </summary>
void PrintShieldTimer();
/// <summary>
/// Check if player hits a powerup and collect it
/// </summary>
/// <returns>true if tile has a powerup else false</returns>
bool CheckForPowerups(Tile* tile);
};