-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEntity_.h
58 lines (45 loc) · 1.38 KB
/
Entity_.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
#include <iostream>
#include <vector>
#include "Global.h"
#include "Utilities.h"
/*
ENTITY CLASS
Constructor's parameters:
- Global* global
About this class:
- This class is a template for entity type classes.
- To change the class name:
- Firstly, ctrl+d 'Entity_' and change it to the new class name (uppercase first character);
- Secondly ctrl+d 'entity' and change it to the new class name (lowercase first character);
- Do this for both .h and .cpp files;
- Change at the beginning of this comment section the full uppercase class name too.
(In fact, change this entire comment section).
- POSSIBLE ERRORS. Don't forget to add the new class name to the run.py and change the #include
and entities declaration at Game.h.
*/
class Entity_
{
private:
//Variables
//Global variables
Global* global;
//Custom constants (maxEntities, maxSize...)
//Game logic (counters, nEntities...)
//Game objects
sf::Vector2f entityPos;
sf::Vector2f entityVel;
sf::CircleShape shape;
//Private functions
void initVariables();
void initShape();
public:
//Constructors / Destructors
Entity_(Global* global);
virtual ~Entity_();
//Accessors
Utilities utilities;
//Functions
void update(float dt);
void render(sf::RenderTarget* target);
};