Skip to content

Commit

Permalink
Improved death mechanics of livefire
Browse files Browse the repository at this point in the history
  • Loading branch information
LMH0013 authored and tobbi committed Oct 26, 2013
1 parent c52b9f5 commit ac0af77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
10 changes: 1 addition & 9 deletions data/images/creatures/livefire/livefire.sprite
Expand Up @@ -44,15 +44,7 @@
"extinguish-left-3.png"
"extinguish-left-4.png"
"extinguish-left-5.png"
"extinguish-left-4.png"
"extinguish-left-5.png"
"extinguish-left-5.png"
"extinguish-left-5.png"
"extinguish-left-5.png"
"extinguish-left-5.png"
"extinguish-left-5.png"
"extinguish-left-5.png"
"extinguish-left-5.png"))
"extinguish-left-4.png"))
(action
(name "extinguish-right")
(fps 6.0)
Expand Down
10 changes: 8 additions & 2 deletions src/badguy/livefire.cpp
Expand Up @@ -59,6 +59,10 @@ LiveFire::collision_badguy(BadGuy& badguy, const CollisionHit& hit)
void
LiveFire::active_update(float elapsed_time) {

// Remove when extinguish animation is done
if((sprite->get_action() == "extinguish-left" || sprite->get_action() == "extinguish-right" )
&& sprite->animation_done()) remove_me();

if(state == STATE_WALKING) {
WalkingBadguy::active_update(elapsed_time);
return;
Expand Down Expand Up @@ -139,11 +143,13 @@ LiveFire::kill_fall()
Vector paccel = Vector(0,0);
Sector::current()->add_object(new SpriteParticle("images/objects/particles/smoke.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_BACKGROUNDTILES+2));
// extinguish the flame
sprite->set_action(dir == LEFT ? "extinguish-left" : "extinguish-right");
sprite->set_action(dir == LEFT ? "extinguish-left" : "extinguish-right", 1);
physic.set_velocity_y(0);
physic.set_acceleration_y(0);
physic.enable_gravity(false);
set_state(STATE_SQUISHED); // used to nullify any threat and remove
lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
lightsprite->set_color(Color(0.5f, 0.4f, 0.3f));
set_group(COLGROUP_DISABLED);

// start dead-script
run_dead_script();
Expand Down

0 comments on commit ac0af77

Please sign in to comment.