-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.hpp
More file actions
58 lines (45 loc) · 1.59 KB
/
Copy pathPlayer.hpp
File metadata and controls
58 lines (45 loc) · 1.59 KB
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
#ifndef EXAMPLE_PLAYER_HPP
#define EXAMPLE_PLAYER_HPP
#include <Tails/World/Actor.hpp>
#include <Tails/Input/ActionHandle.hpp>
#include <Tails/Assets/AssetPtr.hpp>
#include <Tails/Assets/Texture.hpp>
namespace tails
{
class CCameraComponent;
namespace input
{
struct SAction;
struct SActionValue;
}
}
class CPlayer final : public tails::CActor
{
public:
CPlayer();
void shoot();
private:
void onSpawn() override;
void onTick(float deltaSeconds) override;
void onStartCollision(CActor* otherActor, tails::CComponent* otherComponent) override;
void onEndCollision(CActor* otherActor, tails::CComponent* otherComponent) override;
void handleMoveDown(tails::input::SActionValue actionValue);
void handleMoveRight(tails::input::SActionValue actionValue);
void handleStartSprint(tails::input::SActionValue actionValue);
void handleStopSprint(tails::input::SActionValue actionValue);
void handleStartShooting(tails::input::SActionValue actionValue);
void handleStopShooting(tails::input::SActionValue actionValue);
tails::CCameraComponent* m_cameraComponent;
tails::input::SActionHandle m_moveDownAction;
tails::input::SActionHandle m_moveRightAction;
tails::input::SActionHandle m_sprintAction;
tails::input::SActionHandle m_shootAction;
float m_currentSpeed;
float m_sprintSpeed {500.f};
float m_walkSpeed {250.f};
bool m_wishShoot {false};
float m_shootTimer {0.f};
float m_fireRate {0.1f};
tails::TAssetPtr<tails::CTexture> m_sprite {"face.png"};
};
#endif // EXAMPLE_PLAYER_HPP