-
Notifications
You must be signed in to change notification settings - Fork 9
/
CtrlPanel.h
39 lines (37 loc) · 1.06 KB
/
CtrlPanel.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
#ifndef CtrlPanel_H
#define CtrlPanel_H
#include "WorldObject.h"
#include "Game.h"
#include "Animation.h"
class CtrlPanel : public WorldObject
{
public:
CtrlPanel(Game& g);
void handleCollision(WorldObject &b){};
void draw(sf::RenderTarget &target);
void step(float dt);
void reset(){};
void receiveMessage(const Message& msg);
private:
void initSettingAngle(Player *pl);
void postSettingAngle();
void changePower(int delta,Player *pl);
Game& _game;
int fpsi;
size_t p;
bool settingPower;
bool settingAngle; //if setting angle change angle of the turret by deltaX
int prevMouseX; //deltaX = mouse.x - prevMouseX , change angle in degrees
sf::Vector2i mouseOldCoord;// used to reset mouse to old position after setting angle
sf::Clock fpsTimer;
sf::Text fps;
sf::Text player;
sf::Text rotation;
sf::Text power;
sf::Text fire;
sf::RectangleShape gaugeBg;
sf::RectangleShape gaugeFill;
sf::Sprite crosshair;
std::unique_ptr<Animation> currPlayerMarker;
};
#endif // CtrlPanel_H