Added Warrior swing sword animation
This commit is contained in:
+15
-10
@@ -5,6 +5,7 @@
|
||||
#include "State.h"
|
||||
|
||||
struct Player{
|
||||
friend class Crawler;
|
||||
private:
|
||||
int hp=100,maxhp=hp;
|
||||
int atk=10;
|
||||
@@ -22,20 +23,29 @@ private:
|
||||
float spin_angle=0;
|
||||
float lastAnimationFlip=0;
|
||||
float groundSlamCooldown=0;
|
||||
float swordSwingTimer=0;
|
||||
State state=State::NORMAL;
|
||||
Animate2D::Animation<AnimationState>animation;
|
||||
Animate2D::AnimationState internal_animState;
|
||||
Key lastReleasedMovementKey;
|
||||
Key facingDirection;
|
||||
void AddAnimation(AnimationState state);
|
||||
void Update(float fElapsedTime);
|
||||
void SetSwordSwingTimer(float val);
|
||||
void SetState(State newState);
|
||||
void SetFacingDirection(Key direction);
|
||||
void SetLastReleasedMovementKey(Key k);
|
||||
void Spin(float duration,float spinSpd);
|
||||
void SetX(float x);
|
||||
void SetY(float y);
|
||||
void SetZ(float z);
|
||||
void SetPos(vf2d pos);
|
||||
protected:
|
||||
public:
|
||||
Player();
|
||||
Player(vf2d pos);
|
||||
const static float GROUND_SLAM_SPIN_TIME;
|
||||
const static float GROUND_SLAM_COOLDOWN;
|
||||
void SetX(float x);
|
||||
void SetY(float y);
|
||||
void SetZ(float z);
|
||||
void SetPos(vf2d pos);
|
||||
vf2d&GetPos();
|
||||
float GetX();
|
||||
float GetY();
|
||||
@@ -48,19 +58,14 @@ public:
|
||||
float GetAttackRangeMult();
|
||||
float GetSpinAngle();
|
||||
State GetState();
|
||||
void SetFacingDirection(Key direction);
|
||||
Key GetFacingDirection();
|
||||
vf2d GetVelocity();
|
||||
|
||||
void Hurt(int damage);
|
||||
|
||||
void Spin(float duration,float spinSpd);
|
||||
void Update(float fElapsedTime);
|
||||
void AddAnimation(AnimationState state);
|
||||
void UpdateAnimation(AnimationState animState);
|
||||
Animate2D::Frame GetFrame();
|
||||
void SetLastReleasedMovementKey(Key k);
|
||||
Key GetLastReleasedMovementKey();
|
||||
float GetSwordSwingTimer();
|
||||
|
||||
float GetGroundSlamCooldown();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user