Added mini particles for teleporting.
This commit is contained in:
parent
88666b1d61
commit
78b6113d8e
@ -17,5 +17,5 @@ enum AnimationState{
|
|||||||
WARRIOR_SWINGSONICSWORD_S,WARRIOR_SWINGSONICSWORD_E,WARRIOR_SWINGSONICSWORD_N,WARRIOR_SWINGSONICSWORD_W,
|
WARRIOR_SWINGSONICSWORD_S,WARRIOR_SWINGSONICSWORD_E,WARRIOR_SWINGSONICSWORD_N,WARRIOR_SWINGSONICSWORD_W,
|
||||||
WIZARD_IDLE_ATTACK_S,WIZARD_IDLE_ATTACK_E,WIZARD_IDLE_ATTACK_N,WIZARD_IDLE_ATTACK_W,
|
WIZARD_IDLE_ATTACK_S,WIZARD_IDLE_ATTACK_E,WIZARD_IDLE_ATTACK_N,WIZARD_IDLE_ATTACK_W,
|
||||||
WIZARD_ATTACK_S,WIZARD_ATTACK_E,WIZARD_ATTACK_N,WIZARD_ATTACK_W,
|
WIZARD_ATTACK_S,WIZARD_ATTACK_E,WIZARD_ATTACK_N,WIZARD_ATTACK_W,
|
||||||
ENERGY_BOLT,ENERGY_PARTICLE,SPLASH_EFFECT,
|
ENERGY_BOLT,ENERGY_PARTICLE,SPLASH_EFFECT,DOT_PARTICLE,
|
||||||
};
|
};
|
@ -316,6 +316,9 @@ bool Wizard::RightClickAbility(){
|
|||||||
p.teleportTarget=teleportPoint;
|
p.teleportTarget=teleportPoint;
|
||||||
p.teleportStartPosition=p.GetPos();
|
p.teleportStartPosition=p.GetPos();
|
||||||
p.iframe_time=0.35;
|
p.iframe_time=0.35;
|
||||||
|
for(int i=0;i<16;i++){
|
||||||
|
game->AddEffect(Effect(p.GetPos()+vf2d{(rand()%160-80)/10.f,(rand()%160-80)/10.f},float(rand()%300)/1000,AnimationState::DOT_PARTICLE,0.3,0.2,{float(rand()%1000-500)/100,float(rand()%1000-500)/100},BLACK));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
p.notificationDisplay={"Cannot Teleport to that location!",0.5};
|
p.notificationDisplay={"Cannot Teleport to that location!",0.5};
|
||||||
|
@ -362,6 +362,10 @@ void Crawler::InitializeAnimations(){
|
|||||||
splash_animation.AddFrame({&GFX_Splash_Effect,{{i*24,0},{24,24}}});
|
splash_animation.AddFrame({&GFX_Splash_Effect,{{i*24,0},{24,24}}});
|
||||||
}
|
}
|
||||||
ANIMATION_DATA[AnimationState::SPLASH_EFFECT]=splash_animation;
|
ANIMATION_DATA[AnimationState::SPLASH_EFFECT]=splash_animation;
|
||||||
|
|
||||||
|
Animate2D::FrameSequence dot_particle;
|
||||||
|
dot_particle.AddFrame({&GFX_BulletCircle,{{0,0},{3,3}}});
|
||||||
|
ANIMATION_DATA[AnimationState::DOT_PARTICLE]=dot_particle;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Crawler::LeftHeld(){
|
bool Crawler::LeftHeld(){
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
INCLUDE_ANIMATION_DATA
|
INCLUDE_ANIMATION_DATA
|
||||||
INCLUDE_game
|
INCLUDE_game
|
||||||
|
|
||||||
Effect::Effect(vf2d pos,float lifetime,AnimationState animation,float size,float fadeout,vf2d spd)
|
Effect::Effect(vf2d pos,float lifetime,AnimationState animation,float size,float fadeout,vf2d spd,Pixel col)
|
||||||
:pos(pos),lifetime(lifetime),size(size),fadeout(fadeout),original_fadeoutTime(fadeout),spd(spd){
|
:pos(pos),lifetime(lifetime),size(size),fadeout(fadeout),original_fadeoutTime(fadeout),spd(spd),col(col){
|
||||||
this->animation.AddState(animation,ANIMATION_DATA[animation]);
|
this->animation.AddState(animation,ANIMATION_DATA[animation]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,9 +25,9 @@ bool Effect::Update(float fElapsedTime){
|
|||||||
|
|
||||||
void Effect::Draw(){
|
void Effect::Draw(){
|
||||||
if(fadeout==0){
|
if(fadeout==0){
|
||||||
game->view.DrawPartialDecal(pos-GetFrame().GetSourceRect().size/2,GetFrame().GetSourceImage()->Decal(),GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size);
|
game->view.DrawPartialDecal(pos-GetFrame().GetSourceRect().size/2,GetFrame().GetSourceImage()->Decal(),GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,{size,size},col);
|
||||||
} else {
|
} else {
|
||||||
game->view.DrawPartialDecal(pos-GetFrame().GetSourceRect().size/2,GetFrame().GetSourceImage()->Decal(),GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,{1,1},{255,255,255,uint8_t(fadeout/original_fadeoutTime*255)});
|
game->view.DrawPartialDecal(pos-GetFrame().GetSourceRect().size/2,GetFrame().GetSourceImage()->Decal(),GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,{size,size},{col.r,col.g,col.b,uint8_t(fadeout/original_fadeoutTime*255)});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,8 +8,9 @@ struct Effect{
|
|||||||
float lifetime=0;
|
float lifetime=0;
|
||||||
float fadeout=0;
|
float fadeout=0;
|
||||||
float size=1;
|
float size=1;
|
||||||
|
Pixel col=WHITE;
|
||||||
vf2d spd={};
|
vf2d spd={};
|
||||||
Effect(vf2d pos,float lifetime,AnimationState animation,float size=1.0f,float fadeout=0.0f,vf2d spd={});
|
Effect(vf2d pos,float lifetime,AnimationState animation,float size=1.0f,float fadeout=0.0f,vf2d spd={},Pixel col=WHITE);
|
||||||
bool Update(float fElapsedTime);
|
bool Update(float fElapsedTime);
|
||||||
Animate2D::Frame GetFrame();
|
Animate2D::Frame GetFrame();
|
||||||
void Draw();
|
void Draw();
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 448
|
#define VERSION_BUILD 451
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user