Implemented blocking. Made player abilities dynamic instead of fixed for class expansion preparation.

This commit is contained in:
2023-06-17 21:19:08 -05:00
parent 75b763e87b
commit e090bc775d
11 changed files with 183 additions and 26 deletions
+4 -4
View File
@@ -3,6 +3,7 @@
#include "Animation.h"
#include "Monster.h"
#include "State.h"
#include "Ability.h"
struct Player{
friend class Crawler;
@@ -16,13 +17,13 @@ private:
float moveSpd=1.0f;
float size=1.0f;
float attack_range=1.5f;
Ability rightClickAbility,ability1,ability2,ability3;
const float ATTACK_COOLDOWN=0.35f;
float attack_cooldown_timer=0;
float spin_attack_timer=0;
float spin_spd=0;
float spin_angle=0;
float lastAnimationFlip=0;
float groundSlamCooldown=0;
float swordSwingTimer=0;
float iframe_time=0;
State state=State::NORMAL;
@@ -44,9 +45,7 @@ private:
protected:
public:
Player();
Player(vf2d pos);
const static float GROUND_SLAM_SPIN_TIME;
const static float GROUND_SLAM_COOLDOWN;
vf2d&GetPos();
float GetX();
float GetY();
@@ -69,7 +68,8 @@ public:
Key GetLastReleasedMovementKey();
float GetSwordSwingTimer();
float GetGroundSlamCooldown();
float GetAbility2Cooldown();
float GetRightClickCooldown();
//Triggers when the player has moved.
void Moved();