This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuilder_object.hpp
96 lines (79 loc) · 2.84 KB
/
builder_object.hpp
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef LINE_HPP
#define LINE_HPP
#include <SFML/Graphics.hpp>
#include <vector>
#include <memory>
#include "object.hpp"
enum line_type {GRASS, RAILS, WATER, ROAD};
// builder_object class, heritage van object
class builder_object : public object {
private:
unsigned int ticks;
unsigned int speed_car = 2;
line_type type;
// Wegems refrence niet nodig.
std::vector<std::string> sprites_car = {"car_cool_left_sprite", "car_cool_right_sprite", "car_camper_left_sprite", "car_camper_right_sprite", "car_orange_left_sprite", "car_orange_right_sprite", "car_pink_left_sprite", "car_pink_right_sprite", "car_police_left_sprite", "car_police_right_sprite"};
std::vector<std::string> sprites_log = {"tree_trunk_2t_sprite", "tree_trunk_3t_sprite"};
/**
* @brief The generate_coin function will have a certain change to generate a coin on the line when called.
*
*/
void generate_coins();
/**
* @brief The generate_obstacle_car will generate a certain amount of differaint types of cars when called.
*
*/
void generate_obstacle_car();
/**
* @brief The generate_obstacle_grass will generate a certainn amount of rocks and trees when called.
*
*/
void generate_obstacle_grass();
/**
* @brief The generate_obstacle_train will generate a train when called.
*
*/
void generate_obstacle_train();
/**
* @brief The generate_obstacle_logs will generate a certain amount of logs when called.
*
*/
void generate_obstacle_logs();
const unsigned int max_amount_obstacles_per_tile;
public:
/**
* @brief Construct a new builder object object
*
* @param window A reference to the window where everything is drawn on.
* @param position The position on which the line will be placed on.
* @param size The size on how large a line will be.
* @param type The type a line could be.
* @param object_state The state a is in.
* @param sprite_name The name of the sprite.
* @param ticks The amount of ticks that has passed.
*/
builder_object(sf::RenderWindow& window,
sf::Vector2f position,
sf::Vector2f size,
line_type type,
object_states object_state,
std::string sprite_name,
unsigned int ticks = 0);
std::vector<std::shared_ptr<object>> objects_for_level;
/**
* @brief The draw function will call all objects draw function and update the position of itself.
*
*/
void draw() override;
/**
* @brief The update function will call all the objects update function.
*
*/
void update();
/**
* @brief The lower function will call all objects lower function and lower the position of itself.
*
*/
void lower() override;
};
#endif