Added mini particles for teleporting.

pull/28/head
sigonasr2 2 years ago
parent 88666b1d61
commit 78b6113d8e
  1. 2
      Crawler/Animation.h
  2. 3
      Crawler/Class.cpp
  3. 4
      Crawler/Crawler.cpp
  4. 8
      Crawler/Effect.cpp
  5. 3
      Crawler/Effect.h
  6. 2
      Crawler/Version.h

@ -17,5 +17,5 @@ enum AnimationState{
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_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.teleportStartPosition=p.GetPos();
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;
} else {
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}}});
}
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(){

@ -5,8 +5,8 @@
INCLUDE_ANIMATION_DATA
INCLUDE_game
Effect::Effect(vf2d pos,float lifetime,AnimationState animation,float size,float fadeout,vf2d spd)
:pos(pos),lifetime(lifetime),size(size),fadeout(fadeout),original_fadeoutTime(fadeout),spd(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),col(col){
this->animation.AddState(animation,ANIMATION_DATA[animation]);
}
@ -25,9 +25,9 @@ bool Effect::Update(float fElapsedTime){
void Effect::Draw(){
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 {
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 fadeout=0;
float size=1;
Pixel col=WHITE;
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);
Animate2D::Frame GetFrame();
void Draw();

@ -2,7 +2,7 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 0
#define VERSION_BUILD 448
#define VERSION_BUILD 451
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Loading…
Cancel
Save