-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPlanetarySystem.h
More file actions
38 lines (30 loc) · 944 Bytes
/
PlanetarySystem.h
File metadata and controls
38 lines (30 loc) · 944 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
// Planet and Star classes
#ifndef PLSYS
#define PLSYS
#include "FarOut/FarOut.h"
#include <math.h>
class Star : public GameObject {
public:
Star();
Star(int size, sf::Color outline, int outlineWidth, sf::Color fill, sf::Vector2f position);
void draw(sf::RenderTarget& target, sf::RenderStates states)const;
void update(sf::Time dt);
private:
sf::CircleShape mass;
sf::CircleShape hitbox;
int radius;
};
class Planet : public GameObject {
public:
Planet(int radius, int orbitDistance, sf::Color color, float movementFactor);
void draw(sf::RenderTarget& target, sf::RenderStates states)const;
void update(sf::Time dt, sf::Vector2f systemCenter);
void update(sf::Time dt);
private:
sf::CircleShape mass;
sf::CircleShape hitbox;
int orbitDistance;
float orbitAngle;
float angleChange;
};
#endif