@ -1,19 +1,20 @@
# include "Animation.h"
# include "Crawler.h"
# include "DEFINES.h"
# include "safemap.h"
INCLUDE_game
INCLUDE_ANIMATION_DATA
void sig : : Animation : : InitializeAnimations ( ) {
auto CreateStillAnimation = [ & ] ( Renderable & img , vf2d size , AnimationState state , AnimationData data = { } ) {
auto CreateStillAnimation = [ & ] ( Renderable & img , vf2d size , std : : string state , AnimationData data = { } ) {
Animate2D : : FrameSequence anim ( data . frameDuration , data . style ) ;
anim . AddFrame ( { & img , { { 0 , 0 } , size } } ) ;
ANIMATION_DATA [ state ] = anim ;
} ;
auto CreateHorizontalAnimationSequence = [ & ] ( Renderable & img , int frameCount , vf2d size , AnimationState state , AnimationData data = { } ) {
auto CreateHorizontalAnimationSequence = [ & ] ( Renderable & img , int frameCount , vf2d size , std : : string state , AnimationData data = { } ) {
Animate2D : : FrameSequence anim ( data . frameDuration , data . style ) ;
for ( int i = 0 ; i < frameCount ; i + + ) {
anim . AddFrame ( { & img , { { int ( i * size . x ) , 0 } , size } } ) ;
@ -21,47 +22,47 @@ void sig::Animation::InitializeAnimations(){
ANIMATION_DATA [ state ] = anim ;
} ;
auto SetupClassWalkIdleAnimations = [ & ] ( Renderable & sheet , AnimationState WALK_S_ANIMATION ) {
auto SetupClassWalkIdleAnimations = [ & ] ( Renderable & sheet , std : : string className ) {
Animate2D : : FrameSequence pl_walk_s { 0.2 } ;
pl_walk_s . AddFrame ( { & sheet , { vi2d { 0 , 0 } * 24 , { 24 , 24 } } } ) ;
pl_walk_s . AddFrame ( { & sheet , { vi2d { 1 , 0 } * 24 , { 24 , 24 } } } ) ;
pl_walk_s . AddFrame ( { & sheet , { vi2d { 0 , 0 } * 24 , { 24 , 24 } } } ) ;
pl_walk_s . AddFrame ( { & sheet , { vi2d { 2 , 0 } * 24 , { 24 , 24 } } } ) ;
ANIMATION_DATA [ AnimationState ( WALK_S_ANIMATION + 0 ) ] = pl_walk_s ;
ANIMATION_DATA [ className + " _WALK_S " ] = pl_walk_s ;
Animate2D : : FrameSequence pl_walk_e { 0.2 } ;
pl_walk_e . AddFrame ( { & sheet , { vi2d { 0 , 3 } * 24 , { 24 , 24 } } } ) ;
pl_walk_e . AddFrame ( { & sheet , { vi2d { 1 , 3 } * 24 , { 24 , 24 } } } ) ;
pl_walk_e . AddFrame ( { & sheet , { vi2d { 0 , 3 } * 24 , { 24 , 24 } } } ) ;
pl_walk_e . AddFrame ( { & sheet , { vi2d { 2 , 3 } * 24 , { 24 , 24 } } } ) ;
ANIMATION_DATA [ AnimationState ( WALK_S_ANIMATION + 1 ) ] = pl_walk_e ;
ANIMATION_DATA [ className + " _WALK_E " ] = pl_walk_e ;
Animate2D : : FrameSequence pl_walk_w { 0.2 } ;
pl_walk_w . AddFrame ( { & sheet , { vi2d { 0 , 2 } * 24 , { 24 , 24 } } } ) ;
pl_walk_w . AddFrame ( { & sheet , { vi2d { 1 , 2 } * 24 , { 24 , 24 } } } ) ;
pl_walk_w . AddFrame ( { & sheet , { vi2d { 0 , 2 } * 24 , { 24 , 24 } } } ) ;
pl_walk_w . AddFrame ( { & sheet , { vi2d { 2 , 2 } * 24 , { 24 , 24 } } } ) ;
ANIMATION_DATA [ AnimationState ( WALK_S_ANIMATION + 3 ) ] = pl_walk_w ;
ANIMATION_DATA [ className + " _WALK_W " ] = pl_walk_w ;
Animate2D : : FrameSequence pl_walk_n { 0.2 } ;
pl_walk_n . AddFrame ( { & sheet , { vi2d { 0 , 1 } * 24 , { 24 , 24 } } } ) ;
pl_walk_n . AddFrame ( { & sheet , { vi2d { 1 , 1 } * 24 , { 24 , 24 } } } ) ;
pl_walk_n . AddFrame ( { & sheet , { vi2d { 0 , 1 } * 24 , { 24 , 24 } } } ) ;
pl_walk_n . AddFrame ( { & sheet , { vi2d { 2 , 1 } * 24 , { 24 , 24 } } } ) ;
ANIMATION_DATA [ AnimationState ( WALK_S_ANIMATION + 2 ) ] = pl_walk_n ;
ANIMATION_DATA [ className + " _WALK_N " ] = pl_walk_n ;
Animate2D : : FrameSequence pl_idle_s ;
pl_idle_s . AddFrame ( { & sheet , { vi2d { 0 , 0 } * 24 , { 24 , 24 } } } ) ;
ANIMATION_DATA [ AnimationState ( WALK_S_ANIMATION + 4 ) ] = pl_idle_s ;
ANIMATION_DATA [ className + " _IDLE_S " ] = pl_idle_s ;
Animate2D : : FrameSequence pl_idle_e ;
pl_idle_e . AddFrame ( { & sheet , { vi2d { 0 , 3 } * 24 , { 24 , 24 } } } ) ;
ANIMATION_DATA [ AnimationState ( WALK_S_ANIMATION + 5 ) ] = pl_idle_e ;
ANIMATION_DATA [ className + " _IDLE_E " ] = pl_idle_e ;
Animate2D : : FrameSequence pl_idle_w ;
pl_idle_w . AddFrame ( { & sheet , { vi2d { 0 , 2 } * 24 , { 24 , 24 } } } ) ;
ANIMATION_DATA [ AnimationState ( WALK_S_ANIMATION + 7 ) ] = pl_idle_w ;
ANIMATION_DATA [ className + " _IDLE_W " ] = pl_idle_w ;
Animate2D : : FrameSequence pl_idle_n ;
pl_idle_n . AddFrame ( { & sheet , { vi2d { 0 , 1 } * 24 , { 24 , 24 } } } ) ;
ANIMATION_DATA [ AnimationState ( WALK_S_ANIMATION + 6 ) ] = pl_idle_n ;
ANIMATION_DATA [ className + " _IDLE_N " ] = pl_idle_n ;
} ;
//Warrior animations.
SetupClassWalkIdleAnimations ( game - > GFX_Warrior_Sheet , AnimationState : : WARRIOR_WALK_S ) ;
SetupClassWalkIdleAnimations ( game - > GFX_Warrior_Sheet , " WARRIOR " ) ;
Animate2D : : FrameSequence pl_warrior_swing_s ( 0.05 ) , pl_warrior_swing_n ( 0.05 ) , pl_warrior_swing_e ( 0.05 ) , pl_warrior_swing_w ( 0.05 ) ;
Animate2D : : FrameSequence pl_warrior_sonic_swing_s ( 0.1 , Animate2D : : Style : : OneShot ) , pl_warrior_sonic_swing_n ( 0.1 , Animate2D : : Style : : OneShot ) , pl_warrior_sonic_swing_e ( 0.1 , Animate2D : : Style : : OneShot ) , pl_warrior_sonic_swing_w ( 0.1 , Animate2D : : Style : : OneShot ) ;
for ( int i = 0 ; i < 4 ; i + + ) {
@ -80,17 +81,17 @@ void sig::Animation::InitializeAnimations(){
pl_warrior_swing_e . AddFrame ( { & game - > GFX_Warrior_Sheet , { vi2d { 4 + i , 3 } * 24 , { 24 , 24 } } } ) ;
pl_warrior_sonic_swing_e . AddFrame ( { & game - > GFX_Warrior_Sheet , { vi2d { 4 + i , 7 } * 24 , { 24 , 24 } } } ) ;
}
ANIMATION_DATA [ AnimationState : : WARRIOR_SWINGSWORD_N ] = pl_warrior_swing_n ;
ANIMATION_DATA [ AnimationState : : WARRIOR_SWINGSWORD_E ] = pl_warrior_swing_e ;
ANIMATION_DATA [ AnimationState : : WARRIOR_SWINGSWORD_S ] = pl_warrior_swing_s ;
ANIMATION_DATA [ AnimationState : : WARRIOR_SWINGSWORD_W ] = pl_warrior_swing_w ;
ANIMATION_DATA [ AnimationState : : WARRIOR_SWINGSONICSWORD_N ] = pl_warrior_sonic_swing_n ;
ANIMATION_DATA [ AnimationState : : WARRIOR_SWINGSONICSWORD_E ] = pl_warrior_sonic_swing_e ;
ANIMATION_DATA [ AnimationState : : WARRIOR_SWINGSONICSWORD_S ] = pl_warrior_sonic_swing_s ;
ANIMATION_DATA [ AnimationState : : WARRIOR_SWINGSONICSWORD_W ] = pl_warrior_sonic_swing_w ;
ANIMATION_DATA [ " WARRIOR_SWINGSWORD_N " ] = pl_warrior_swing_n ;
ANIMATION_DATA [ " WARRIOR_SWINGSWORD_E " ] = pl_warrior_swing_e ;
ANIMATION_DATA [ " WARRIOR_SWINGSWORD_S " ] = pl_warrior_swing_s ;
ANIMATION_DATA [ " WARRIOR_SWINGSWORD_W " ] = pl_warrior_swing_w ;
ANIMATION_DATA [ " WARRIOR_SWINGSONICSWORD_N " ] = pl_warrior_sonic_swing_n ;
ANIMATION_DATA [ " WARRIOR_SWINGSONICSWORD_E " ] = pl_warrior_sonic_swing_e ;
ANIMATION_DATA [ " WARRIOR_SWINGSONICSWORD_S " ] = pl_warrior_sonic_swing_s ;
ANIMATION_DATA [ " WARRIOR_SWINGSONICSWORD_W " ] = pl_warrior_sonic_swing_w ;
//Ranger animations
SetupClassWalkIdleAnimations ( game - > GFX_Ranger_Sheet , AnimationState : : RANGER_WALK_S ) ;
SetupClassWalkIdleAnimations ( game - > GFX_Ranger_Sheet , " RANGER " ) ;
Animate2D : : FrameSequence pl_ranger_shoot_s , pl_ranger_shoot_n , pl_ranger_shoot_e , pl_ranger_shoot_w ;
for ( int i = 0 ; i < 3 ; i + + ) {
pl_ranger_shoot_s . AddFrame ( { & game - > GFX_Ranger_Sheet , { vi2d { 3 + i , 0 } * 24 , { 24 , 24 } } } ) ;
@ -98,25 +99,25 @@ void sig::Animation::InitializeAnimations(){
pl_ranger_shoot_e . AddFrame ( { & game - > GFX_Ranger_Sheet , { vi2d { 3 + i , 3 } * 24 , { 24 , 24 } } } ) ;
pl_ranger_shoot_w . AddFrame ( { & game - > GFX_Ranger_Sheet , { vi2d { 3 + i , 2 } * 24 , { 24 , 24 } } } ) ;
}
ANIMATION_DATA [ AnimationState : : RANGER_SHOOT_S ] = pl_ranger_shoot_s ;
ANIMATION_DATA [ AnimationState : : RANGER_SHOOT_N ] = pl_ranger_shoot_n ;
ANIMATION_DATA [ AnimationState : : RANGER_SHOOT_E ] = pl_ranger_shoot_e ;
ANIMATION_DATA [ AnimationState : : RANGER_SHOOT_W ] = pl_ranger_shoot_w ;
ANIMATION_DATA [ " RANGER_SHOOT_S " ] = pl_ranger_shoot_s ;
ANIMATION_DATA [ " RANGER_SHOOT_N " ] = pl_ranger_shoot_n ;
ANIMATION_DATA [ " RANGER_SHOOT_E " ] = pl_ranger_shoot_e ;
ANIMATION_DATA [ " RANGER_SHOOT_W " ] = pl_ranger_shoot_w ;
//Wizard animations
SetupClassWalkIdleAnimations ( game - > GFX_Wizard_Sheet , AnimationState : : WIZARD_WALK_S ) ;
SetupClassWalkIdleAnimations ( game - > GFX_Wizard_Sheet , " WIZARD " ) ;
Animate2D : : FrameSequence pl_wizard_idle_attack_s ;
pl_wizard_idle_attack_s . AddFrame ( { & game - > GFX_Wizard_Sheet , { vi2d { 4 , 0 } * 24 , { 24 , 24 } } } ) ;
ANIMATION_DATA [ AnimationState : : WIZARD_IDLE_ATTACK_S ] = pl_wizard_idle_attack_s ;
ANIMATION_DATA [ " WIZARD_IDLE_ATTACK_S " ] = pl_wizard_idle_attack_s ;
Animate2D : : FrameSequence pl_wizard_idle_attack_e ;
pl_wizard_idle_attack_e . AddFrame ( { & game - > GFX_Wizard_Sheet , { vi2d { 4 , 3 } * 24 , { 24 , 24 } } } ) ;
ANIMATION_DATA [ AnimationState : : WIZARD_IDLE_ATTACK_E ] = pl_wizard_idle_attack_e ;
ANIMATION_DATA [ " WIZARD_IDLE_ATTACK_E " ] = pl_wizard_idle_attack_e ;
Animate2D : : FrameSequence pl_wizard_idle_attack_w ;
pl_wizard_idle_attack_w . AddFrame ( { & game - > GFX_Wizard_Sheet , { vi2d { 4 , 2 } * 24 , { 24 , 24 } } } ) ;
ANIMATION_DATA [ AnimationState : : WIZARD_IDLE_ATTACK_W ] = pl_wizard_idle_attack_w ;
ANIMATION_DATA [ " WIZARD_IDLE_ATTACK_W " ] = pl_wizard_idle_attack_w ;
Animate2D : : FrameSequence pl_wizard_idle_attack_n ;
pl_wizard_idle_attack_n . AddFrame ( { & game - > GFX_Wizard_Sheet , { vi2d { 4 , 1 } * 24 , { 24 , 24 } } } ) ;
ANIMATION_DATA [ AnimationState : : WIZARD_IDLE_ATTACK_N ] = pl_wizard_idle_attack_n ;
ANIMATION_DATA [ " 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 ( { & game - > GFX_Wizard_Sheet , { vi2d { 4 + i , 0 } * 24 , { 24 , 24 } } } ) ;
@ -124,7 +125,7 @@ void sig::Animation::InitializeAnimations(){
pl_wizard_attack_s . AddFrame ( { & game - > GFX_Wizard_Sheet , { vi2d { 4 , 0 } * 24 , { 24 , 24 } } } ) ;
}
}
ANIMATION_DATA [ AnimationState : : WIZARD_ATTACK_S ] = pl_wizard_attack_s ;
ANIMATION_DATA [ " 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 ( { & game - > GFX_Wizard_Sheet , { vi2d { 4 + i , 3 } * 24 , { 24 , 24 } } } ) ;
@ -132,7 +133,7 @@ void sig::Animation::InitializeAnimations(){
pl_wizard_attack_e . AddFrame ( { & game - > GFX_Wizard_Sheet , { vi2d { 4 , 3 } * 24 , { 24 , 24 } } } ) ;
}
}
ANIMATION_DATA [ AnimationState : : WIZARD_ATTACK_E ] = pl_wizard_attack_e ;
ANIMATION_DATA [ " 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 ( { & game - > GFX_Wizard_Sheet , { vi2d { 4 + i , 2 } * 24 , { 24 , 24 } } } ) ;
@ -140,7 +141,7 @@ void sig::Animation::InitializeAnimations(){
pl_wizard_attack_w . AddFrame ( { & game - > GFX_Wizard_Sheet , { vi2d { 4 , 2 } * 24 , { 24 , 24 } } } ) ;
}
}
ANIMATION_DATA [ AnimationState : : WIZARD_ATTACK_W ] = pl_wizard_attack_w ;
ANIMATION_DATA [ " 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 ( { & game - > GFX_Wizard_Sheet , { vi2d { 4 + i , 1 } * 24 , { 24 , 24 } } } ) ;
@ -148,30 +149,45 @@ void sig::Animation::InitializeAnimations(){
pl_wizard_attack_n . AddFrame ( { & game - > GFX_Wizard_Sheet , { vi2d { 4 , 1 } * 24 , { 24 , 24 } } } ) ;
}
}
ANIMATION_DATA [ AnimationState : : WIZARD_ATTACK_N ] = pl_wizard_attack_n ;
ANIMATION_DATA [ " WIZARD_ATTACK_N " ] = pl_wizard_attack_n ;
Animate2D : : FrameSequence pl_wizard_cast_s ( 0.1 ) ;
for ( int i = 0 ; i < 2 ; i + + ) {
pl_wizard_cast_s . AddFrame ( { & game - > GFX_Wizard_Sheet , { vi2d { 7 + i , 0 } * 24 , { 24 , 24 } } } ) ;
}
ANIMATION_DATA [ AnimationState : : WIZARD_CAST_S ] = pl_wizard_cast_s ;
ANIMATION_DATA [ " WIZARD_CAST_S " ] = pl_wizard_cast_s ;
Animate2D : : FrameSequence pl_wizard_cast_e ( 0.1 ) ;
for ( int i = 0 ; i < 2 ; i + + ) {
pl_wizard_cast_e . AddFrame ( { & game - > GFX_Wizard_Sheet , { vi2d { 7 + i , 3 } * 24 , { 24 , 24 } } } ) ;
}
ANIMATION_DATA [ AnimationState : : WIZARD_CAST_E ] = pl_wizard_cast_e ;
ANIMATION_DATA [ " WIZARD_CAST_E " ] = pl_wizard_cast_e ;
Animate2D : : FrameSequence pl_wizard_cast_n ( 0.1 ) ;
for ( int i = 0 ; i < 2 ; i + + ) {
pl_wizard_cast_n . AddFrame ( { & game - > GFX_Wizard_Sheet , { vi2d { 7 + i , 1 } * 24 , { 24 , 24 } } } ) ;
}
ANIMATION_DATA [ AnimationState : : WIZARD_CAST_N ] = pl_wizard_cast_n ;
ANIMATION_DATA [ " WIZARD_CAST_N " ] = pl_wizard_cast_n ;
Animate2D : : FrameSequence pl_wizard_cast_w ( 0.1 ) ;
for ( int i = 0 ; i < 2 ; i + + ) {
pl_wizard_cast_w . AddFrame ( { & game - > GFX_Wizard_Sheet , { vi2d { 7 + i , 2 } * 24 , { 24 , 24 } } } ) ;
}
ANIMATION_DATA [ AnimationState : : WIZARD_CAST_W ] = pl_wizard_cast_w ;
ANIMATION_DATA [ " WIZARD_CAST_W " ] = pl_wizard_cast_w ;
//Load slime animations.
for ( int slime = 0 ; slime < 4 ; slime + + ) {
std : : string colorName = " " ;
switch ( slime ) {
case 0 : {
colorName = " GREEN " ;
} break ;
case 1 : {
colorName = " BLUE " ;
} break ;
case 2 : {
colorName = " RED " ;
} break ;
case 3 : {
colorName = " YELLOW " ;
} break ;
}
for ( int state = 0 ; state < 5 ; state + + ) {
Animate2D : : FrameSequence anim ;
if ( state = = 4 ) { //These are death animations.
@ -183,92 +199,112 @@ void sig::Animation::InitializeAnimations(){
for ( int frame = 0 ; frame < 10 ; frame + + ) {
anim . AddFrame ( { & game - > GFX_Slime_Sheet , { vi2d { frame , state + 5 * slime } * 24 , { 24 , 24 } } } ) ;
}
ANIMATION_DATA [ AnimationState ( AnimationState : : GREEN_SLIME_IDLE + state + slime * 5 ) ] = anim ;
std : : string stateName = " " ;
switch ( state ) {
case 0 : {
stateName = " IDLE " ;
} break ;
case 1 : {
stateName = " ROLL " ;
} break ;
case 2 : {
stateName = " JUMP " ;
} break ;
case 3 : {
stateName = " SPIT " ;
} break ;
case 4 : {
stateName = " DIE " ;
} break ;
}
ANIMATION_DATA [ colorName + " _SLIME_ " + stateName ] = anim ;
}
}
CreateHorizontalAnimationSequence ( game - > GFX_Effect_GroundSlam_Back , 5 , { 64 , 64 } , AnimationState : : GROUND_SLAM_ATTACK_BACK , { 0.02 , Animate2D : : Style : : OneShot } ) ;
CreateHorizontalAnimationSequence ( game - > GFX_Effect_GroundSlam_Front , 5 , { 64 , 64 } , AnimationState : : GROUND_SLAM_ATTACK_FRONT , { 0.02 , Animate2D : : Style : : OneShot } ) ;
CreateHorizontalAnimationSequence ( game - > GFX_Battlecry_Effect , 5 , { 84 , 84 } , AnimationState : : BATTLECRY_EFFECT , { 0.02 , Animate2D : : Style : : OneShot } ) ;
CreateHorizontalAnimationSequence ( game - > GFX_SonicSlash , 4 , { 60 , 60 } , AnimationState : : SONICSLASH , { 0.04 , Animate2D : : Style : : OneShot } ) ;
CreateHorizontalAnimationSequence ( game - > GFX_Effect_GroundSlam_Back , 5 , { 64 , 64 } , " GROUND_SLAM_ATTACK_BACK " , { 0.02 , Animate2D : : Style : : OneShot } ) ;
CreateHorizontalAnimationSequence ( game - > GFX_Effect_GroundSlam_Front , 5 , { 64 , 64 } , " GROUND_SLAM_ATTACK_FRONT " , { 0.02 , Animate2D : : Style : : OneShot } ) ;
CreateHorizontalAnimationSequence ( game - > GFX_Battlecry_Effect , 5 , { 84 , 84 } , " BATTLECRY_EFFECT " , { 0.02 , Animate2D : : Style : : OneShot } ) ;
CreateHorizontalAnimationSequence ( game - > GFX_SonicSlash , 4 , { 60 , 60 } , " SONICSLASH " , { 0.04 , Animate2D : : Style : : OneShot } ) ;
CreateStillAnimation ( game - > GFX_EnergyBolt , { 24 , 24 } , AnimationState : : ENERGY_BOLT ) ;
CreateStillAnimation ( game - > GFX_EnergyBolt , { 24 , 24 } , " ENERGY_BOLT " ) ;
CreateHorizontalAnimationSequence ( game - > GFX_EnergyParticle , 3 , { 3 , 3 } , AnimationState : : ENERGY_PARTICLE ) ;
CreateHorizontalAnimationSequence ( game - > GFX_EnergyParticle , 3 , { 3 , 3 } , " ENERGY_PARTICLE " ) ;
CreateHorizontalAnimationSequence ( game - > GFX_Splash_Effect , 5 , { 24 , 24 } , AnimationState : : SPLASH_EFFECT , { 0.05 } ) ;
CreateHorizontalAnimationSequence ( game - > GFX_Splash_Effect , 5 , { 24 , 24 } , " SPLASH_EFFECT " , { 0.05 } ) ;
CreateStillAnimation ( game - > GFX_BulletCircle , { 3 , 3 } , AnimationState : : DOT_PARTICLE ) ;
CreateStillAnimation ( game - > GFX_BulletCircle , { 3 , 3 } , " DOT_PARTICLE " ) ;
CreateHorizontalAnimationSequence ( game - > GFX_LightningBolt , 5 , { 24 , 24 } , AnimationState : : LIGHTNING_BOLT , { 0.03 , Animate2D : : Style : : PingPong } ) ;
CreateHorizontalAnimationSequence ( game - > GFX_LightningBolt , 5 , { 24 , 24 } , " LIGHTNING_BOLT " , { 0.03 , Animate2D : : Style : : PingPong } ) ;
CreateStillAnimation ( game - > GFX_LightningBoltParticle1 , { 5 , 5 } , AnimationState : : LIGHTNING_BOLT_PARTICLE1 ) ;
CreateStillAnimation ( game - > GFX_LightningBoltParticle2 , { 5 , 5 } , AnimationState : : LIGHTNING_BOLT_PARTICLE2 ) ;
CreateStillAnimation ( game - > GFX_LightningBoltParticle3 , { 5 , 5 } , AnimationState : : LIGHTNING_BOLT_PARTICLE3 ) ;
CreateStillAnimation ( game - > GFX_LightningBoltParticle4 , { 5 , 5 } , AnimationState : : LIGHTNING_BOLT_PARTICLE4 ) ;
CreateStillAnimation ( game - > GFX_LightningBoltParticle1 , { 5 , 5 } , " LIGHTNING_BOLT_PARTICLE1 " ) ;
CreateStillAnimation ( game - > GFX_LightningBoltParticle2 , { 5 , 5 } , " LIGHTNING_BOLT_PARTICLE2 " ) ;
CreateStillAnimation ( game - > GFX_LightningBoltParticle3 , { 5 , 5 } , " LIGHTNING_BOLT_PARTICLE3 " ) ;
CreateStillAnimation ( game - > GFX_LightningBoltParticle4 , { 5 , 5 } , " LIGHTNING_BOLT_PARTICLE4 " ) ;
CreateStillAnimation ( game - > GFX_ChainLightning , { 1 , 9 } , AnimationState : : CHAIN_LIGHTNING ) ;
CreateStillAnimation ( game - > GFX_ChainLightning , { 1 , 9 } , " CHAIN_LIGHTNING " ) ;
CreateHorizontalAnimationSequence ( game - > GFX_LightningSplash , 5 , { 24 , 24 } , AnimationState : : LIGHTNING_SPLASH ) ;
CreateHorizontalAnimationSequence ( game - > GFX_LightningSplash , 5 , { 24 , 24 } , " LIGHTNING_SPLASH " ) ;
CreateStillAnimation ( game - > GFX_Meteor , { 192 , 192 } , AnimationState : : METEOR ) ;
CreateStillAnimation ( game - > GFX_Meteor , { 192 , 192 } , " METEOR " ) ;
for ( int i = 0 ; i < 5 ; i + + ) {
Animate2D : : FrameSequence firering ;
firering . AddFrame ( { & game - > GFX_LightningSplash , { { i * 24 , 0 } , { 24 , 24 } } } ) ;
ANIMATION_DATA [ AnimationState ( AnimationState : : FIRE_RING1 + i ) ] = firering ;
ANIMATION_DATA [ " FIRE_RING " + std : : to_string ( i + 1 ) ] = firering ;
}
CreateStillAnimation ( game - > GFX_Arrow , { 24 , 24 } , AnimationState : : ARROW ) ;
CreateStillAnimation ( game - > GFX_ChargedArrow , { 48 , 48 } , AnimationState : : CHARGED_ARROW ) ;
CreateStillAnimation ( game - > GFX_Laser , { 5 , 1 } , AnimationState : : LASER ) ;
CreateStillAnimation ( game - > GFX_Arrow , { 24 , 24 } , " ARROW " ) ;
CreateStillAnimation ( game - > GFX_ChargedArrow , { 48 , 48 } , " CHARGED_ARROW " ) ;
CreateStillAnimation ( game - > GFX_Laser , { 5 , 1 } , " LASER " ) ;
}
void sig : : Animation : : SetupPlayerAnimations ( ) {
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_WALK_N ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_WALK_E ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_WALK_S ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_WALK_W ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_IDLE_N ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_IDLE_E ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_IDLE_S ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_IDLE_W ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_SWINGSWORD_E ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_SWINGSWORD_S ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_SWINGSWORD_N ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_SWINGSWORD_W ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_SWINGSONICSWORD_E ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_SWINGSONICSWORD_S ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_SWINGSONICSWORD_N ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WARRIOR_SWINGSONICSWORD_W ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : RANGER_WALK_N ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : RANGER_WALK_E ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : RANGER_WALK_S ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : RANGER_WALK_W ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : RANGER_IDLE_N ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : RANGER_IDLE_E ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : RANGER_IDLE_S ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : RANGER_IDLE_W ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : RANGER_SHOOT_S ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : RANGER_SHOOT_N ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : RANGER_SHOOT_W ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : RANGER_SHOOT_E ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_WALK_N ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_WALK_E ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_WALK_S ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_WALK_W ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_IDLE_N ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_IDLE_E ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_IDLE_S ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_IDLE_W ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_IDLE_ATTACK_N ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_IDLE_ATTACK_E ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_IDLE_ATTACK_S ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_IDLE_ATTACK_W ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_ATTACK_N ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_ATTACK_E ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_ATTACK_S ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_ATTACK_W ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_CAST_N ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_CAST_E ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_CAST_S ) ;
game - > GetPlayer ( ) - > AddAnimation ( AnimationState : : WIZARD_CAST_W ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_WALK_N " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_WALK_E " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_WALK_S " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_WALK_W " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_IDLE_N " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_IDLE_E " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_IDLE_S " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_IDLE_W " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_SWINGSWORD_E " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_SWINGSWORD_S " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_SWINGSWORD_N " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_SWINGSWORD_W " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_SWINGSONICSWORD_E " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_SWINGSONICSWORD_S " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_SWINGSONICSWORD_N " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WARRIOR_SWINGSONICSWORD_W " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " RANGER_WALK_N " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " RANGER_WALK_E " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " RANGER_WALK_S " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " RANGER_WALK_W " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " RANGER_IDLE_N " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " RANGER_IDLE_E " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " RANGER_IDLE_S " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " RANGER_IDLE_W " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " RANGER_SHOOT_S " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " RANGER_SHOOT_N " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " RANGER_SHOOT_W " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " RANGER_SHOOT_E " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_WALK_N " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_WALK_E " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_WALK_S " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_WALK_W " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_IDLE_N " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_IDLE_E " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_IDLE_S " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_IDLE_W " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_IDLE_ATTACK_N " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_IDLE_ATTACK_E " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_IDLE_ATTACK_S " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_IDLE_ATTACK_W " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_ATTACK_N " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_ATTACK_E " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_ATTACK_S " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_ATTACK_W " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_CAST_N " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_CAST_E " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_CAST_S " ) ;
game - > GetPlayer ( ) - > AddAnimation ( " WIZARD_CAST_W " ) ;
ANIMATION_DATA . SetInitialized ( ) ;
}