|
|
@ -52,6 +52,8 @@ bool Crawler::OnUserCreate(){ |
|
|
|
GFX_Battlecry_Effect.Load("assets/battlecry_effect.png"); |
|
|
|
GFX_Battlecry_Effect.Load("assets/battlecry_effect.png"); |
|
|
|
GFX_Mana.Load("assets/mana.png"); |
|
|
|
GFX_Mana.Load("assets/mana.png"); |
|
|
|
GFX_SonicSlash.Load("assets/sonicslash.png"); |
|
|
|
GFX_SonicSlash.Load("assets/sonicslash.png"); |
|
|
|
|
|
|
|
GFX_BulletCircle.Load("assets/circle.png"); |
|
|
|
|
|
|
|
GFX_BulletCircleOutline.Load("assets/circle_outline.png"); |
|
|
|
|
|
|
|
|
|
|
|
//Animations
|
|
|
|
//Animations
|
|
|
|
InitializeAnimations(); |
|
|
|
InitializeAnimations(); |
|
|
@ -88,6 +90,14 @@ bool Crawler::OnUserCreate(){ |
|
|
|
player.AddAnimation(AnimationState::WIZARD_IDLE_E); |
|
|
|
player.AddAnimation(AnimationState::WIZARD_IDLE_E); |
|
|
|
player.AddAnimation(AnimationState::WIZARD_IDLE_S); |
|
|
|
player.AddAnimation(AnimationState::WIZARD_IDLE_S); |
|
|
|
player.AddAnimation(AnimationState::WIZARD_IDLE_W); |
|
|
|
player.AddAnimation(AnimationState::WIZARD_IDLE_W); |
|
|
|
|
|
|
|
player.AddAnimation(AnimationState::WIZARD_IDLE_ATTACK_N); |
|
|
|
|
|
|
|
player.AddAnimation(AnimationState::WIZARD_IDLE_ATTACK_E); |
|
|
|
|
|
|
|
player.AddAnimation(AnimationState::WIZARD_IDLE_ATTACK_S); |
|
|
|
|
|
|
|
player.AddAnimation(AnimationState::WIZARD_IDLE_ATTACK_W); |
|
|
|
|
|
|
|
player.AddAnimation(AnimationState::WIZARD_ATTACK_N); |
|
|
|
|
|
|
|
player.AddAnimation(AnimationState::WIZARD_ATTACK_E); |
|
|
|
|
|
|
|
player.AddAnimation(AnimationState::WIZARD_ATTACK_S); |
|
|
|
|
|
|
|
player.AddAnimation(AnimationState::WIZARD_ATTACK_W); |
|
|
|
view=TileTransformedView{GetScreenSize(),{1,1}}; |
|
|
|
view=TileTransformedView{GetScreenSize(),{1,1}}; |
|
|
|
|
|
|
|
|
|
|
|
player.SetClass(WARRIOR); |
|
|
|
player.SetClass(WARRIOR); |
|
|
@ -252,6 +262,50 @@ void Crawler::InitializeAnimations(){ |
|
|
|
Animate2D::FrameSequence pl_wizard_idle_n; |
|
|
|
Animate2D::FrameSequence pl_wizard_idle_n; |
|
|
|
pl_wizard_idle_n.AddFrame({&GFX_Wizard_Sheet,{vi2d{0,1}*24,{24,24}}}); |
|
|
|
pl_wizard_idle_n.AddFrame({&GFX_Wizard_Sheet,{vi2d{0,1}*24,{24,24}}}); |
|
|
|
ANIMATION_DATA[AnimationState::WIZARD_IDLE_N]=pl_wizard_idle_n; |
|
|
|
ANIMATION_DATA[AnimationState::WIZARD_IDLE_N]=pl_wizard_idle_n; |
|
|
|
|
|
|
|
Animate2D::FrameSequence pl_wizard_idle_attack_s; |
|
|
|
|
|
|
|
pl_wizard_idle_attack_s.AddFrame({&GFX_Wizard_Sheet,{vi2d{4,0}*24,{24,24}}}); |
|
|
|
|
|
|
|
ANIMATION_DATA[AnimationState::WIZARD_IDLE_ATTACK_S]=pl_wizard_idle_attack_s; |
|
|
|
|
|
|
|
Animate2D::FrameSequence pl_wizard_idle_attack_e; |
|
|
|
|
|
|
|
pl_wizard_idle_attack_e.AddFrame({&GFX_Wizard_Sheet,{vi2d{4,3}*24,{24,24}}}); |
|
|
|
|
|
|
|
ANIMATION_DATA[AnimationState::WIZARD_IDLE_ATTACK_E]=pl_wizard_idle_attack_e; |
|
|
|
|
|
|
|
Animate2D::FrameSequence pl_wizard_idle_attack_w; |
|
|
|
|
|
|
|
pl_wizard_idle_attack_w.AddFrame({&GFX_Wizard_Sheet,{vi2d{4,2}*24,{24,24}}}); |
|
|
|
|
|
|
|
ANIMATION_DATA[AnimationState::WIZARD_IDLE_ATTACK_W]=pl_wizard_idle_attack_w; |
|
|
|
|
|
|
|
Animate2D::FrameSequence pl_wizard_idle_attack_n; |
|
|
|
|
|
|
|
pl_wizard_idle_attack_n.AddFrame({&GFX_Wizard_Sheet,{vi2d{4,1}*24,{24,24}}}); |
|
|
|
|
|
|
|
ANIMATION_DATA[AnimationState::WIZARD_IDLE_ATTACK_N]=pl_wizard_idle_attack_n; |
|
|
|
|
|
|
|
Animate2D::FrameSequence pl_wizard_attack_s(0.2); |
|
|
|
|
|
|
|
for(int i=0;i<3;i++){ |
|
|
|
|
|
|
|
pl_wizard_attack_s.AddFrame({&GFX_Wizard_Sheet,{vi2d{4+i,0}*24,{24,24}}}); |
|
|
|
|
|
|
|
if(i==1){ |
|
|
|
|
|
|
|
pl_wizard_attack_s.AddFrame({&GFX_Wizard_Sheet,{vi2d{4,0}*24,{24,24}}}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ANIMATION_DATA[AnimationState::WIZARD_ATTACK_S]=pl_wizard_attack_s; |
|
|
|
|
|
|
|
Animate2D::FrameSequence pl_wizard_attack_e(0.2); |
|
|
|
|
|
|
|
for(int i=0;i<3;i++){ |
|
|
|
|
|
|
|
pl_wizard_attack_e.AddFrame({&GFX_Wizard_Sheet,{vi2d{4,3}*24,{24,24}}}); |
|
|
|
|
|
|
|
if(i==1){ |
|
|
|
|
|
|
|
pl_wizard_attack_e.AddFrame({&GFX_Wizard_Sheet,{vi2d{4,3}*24,{24,24}}}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ANIMATION_DATA[AnimationState::WIZARD_ATTACK_E]=pl_wizard_attack_e; |
|
|
|
|
|
|
|
Animate2D::FrameSequence pl_wizard_attack_w(0.2); |
|
|
|
|
|
|
|
for(int i=0;i<3;i++){ |
|
|
|
|
|
|
|
pl_wizard_attack_w.AddFrame({&GFX_Wizard_Sheet,{vi2d{4,2}*24,{24,24}}}); |
|
|
|
|
|
|
|
if(i==1){ |
|
|
|
|
|
|
|
pl_wizard_attack_w.AddFrame({&GFX_Wizard_Sheet,{vi2d{4,2}*24,{24,24}}}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ANIMATION_DATA[AnimationState::WIZARD_ATTACK_W]=pl_wizard_attack_w; |
|
|
|
|
|
|
|
Animate2D::FrameSequence pl_wizard_attack_n(0.2); |
|
|
|
|
|
|
|
for(int i=0;i<3;i++){ |
|
|
|
|
|
|
|
pl_wizard_attack_n.AddFrame({&GFX_Wizard_Sheet,{vi2d{4,1}*24,{24,24}}}); |
|
|
|
|
|
|
|
if(i==1){ |
|
|
|
|
|
|
|
pl_wizard_attack_n.AddFrame({&GFX_Wizard_Sheet,{vi2d{4,1}*24,{24,24}}}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ANIMATION_DATA[AnimationState::WIZARD_ATTACK_N]=pl_wizard_attack_n; |
|
|
|
|
|
|
|
|
|
|
|
//Load slime animations.
|
|
|
|
//Load slime animations.
|
|
|
|
for(int slime=0;slime<4;slime++){ |
|
|
|
for(int slime=0;slime<4;slime++){ |
|
|
@ -289,28 +343,28 @@ void Crawler::InitializeAnimations(){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool Crawler::LeftHeld(){ |
|
|
|
bool Crawler::LeftHeld(){ |
|
|
|
return GetKey(LEFT).bHeld|GetKey(A).bHeld; |
|
|
|
return GetKey(LEFT).bHeld||GetKey(A).bHeld; |
|
|
|
} |
|
|
|
} |
|
|
|
bool Crawler::RightHeld(){ |
|
|
|
bool Crawler::RightHeld(){ |
|
|
|
return GetKey(RIGHT).bHeld|GetKey(D).bHeld; |
|
|
|
return GetKey(RIGHT).bHeld||GetKey(D).bHeld; |
|
|
|
} |
|
|
|
} |
|
|
|
bool Crawler::UpHeld(){ |
|
|
|
bool Crawler::UpHeld(){ |
|
|
|
return GetKey(UP).bHeld|GetKey(W).bHeld; |
|
|
|
return GetKey(UP).bHeld||GetKey(W).bHeld; |
|
|
|
} |
|
|
|
} |
|
|
|
bool Crawler::DownHeld(){ |
|
|
|
bool Crawler::DownHeld(){ |
|
|
|
return GetKey(DOWN).bHeld|GetKey(S).bHeld; |
|
|
|
return GetKey(DOWN).bHeld||GetKey(S).bHeld; |
|
|
|
} |
|
|
|
} |
|
|
|
bool Crawler::LeftReleased(){ |
|
|
|
bool Crawler::LeftReleased(){ |
|
|
|
return GetKey(LEFT).bReleased|GetKey(A).bReleased; |
|
|
|
return GetKey(LEFT).bReleased||GetKey(A).bReleased; |
|
|
|
} |
|
|
|
} |
|
|
|
bool Crawler::RightReleased(){ |
|
|
|
bool Crawler::RightReleased(){ |
|
|
|
return GetKey(RIGHT).bReleased|GetKey(D).bReleased; |
|
|
|
return GetKey(RIGHT).bReleased||GetKey(D).bReleased; |
|
|
|
} |
|
|
|
} |
|
|
|
bool Crawler::UpReleased(){ |
|
|
|
bool Crawler::UpReleased(){ |
|
|
|
return GetKey(UP).bReleased|GetKey(W).bReleased; |
|
|
|
return GetKey(UP).bReleased||GetKey(W).bReleased; |
|
|
|
} |
|
|
|
} |
|
|
|
bool Crawler::DownReleased(){ |
|
|
|
bool Crawler::DownReleased(){ |
|
|
|
return GetKey(DOWN).bReleased|GetKey(S).bReleased; |
|
|
|
return GetKey(DOWN).bReleased||GetKey(S).bReleased; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Crawler::HandleUserInput(float fElapsedTime){ |
|
|
|
void Crawler::HandleUserInput(float fElapsedTime){ |
|
|
|