-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject.cpp
More file actions
58 lines (43 loc) · 804 Bytes
/
object.cpp
File metadata and controls
58 lines (43 loc) · 804 Bytes
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
#include "object.h"
Object::Object(float newMass, sf::Vector2f newPosition, sf::Vector2f newVelocity): mass{newMass}, position{newPosition}, velocity{newVelocity}
{
color = sf::Color(rand() % 255, rand() % 255, rand() % 255);
}
sf::FloatRect Object::getRect()
{
return sf::FloatRect{position, {0.f, 0.f}};
}
void Object::draw(sf::RenderTarget &target, sf::RenderStates states) const
{
}
void Object::reload()
{
}
void Object::setColor(sf::Color newColor)
{
color = newColor;
}
sf::Color Object::getColor()
{
return color;
}
float Object::getMass()
{
return mass;
}
sf::Vector2f Object::getPos()
{
return position;
}
sf::Vector2f Object::getVel()
{
return velocity;
}
float Object::getR()
{
return radius;
}
int Object::getPriority() const
{
return 0;
}