(name "walk-right")
(hitbox 10 3 36 72)
(mirror-action "walk-left")
- ))
+ )
+
+ (action
+ (name "headless-left")
+ (fps 12.0)
+ (hitbox 7 8 47 50)
+ (images "headless1.png"
+ "headless2.png"
+ "headless3.png"
+ "headless4.png"
+ "headless5.png"
+ "headless6.png"
+ "headless7.png"
+ "headless8.png"))
+
+ (action
+ (name "headless-right")
+ (hitbox 10 3 36 72)
+ (mirror-action "headless-left")
+ )
+)
;; EOF ;;
snowball_pos.x += 5;
snowball_pos.y += 1;
+ // bounce
+ Player* player = dynamic_cast<Player*>(&object);
+ if (player)
+ player->bounce(*this);
+
+ /* Create death animation for the (now headless) snowman. */
+ set_action (dir == LEFT ? "headless-left" : "headless-right", /* loops = */ -1);
+ set_pos (get_pos () + Vector (-4.0, 19.0)); /* difference in the sprite offsets */
+ physic.set_velocity_y(0);
+ physic.set_acceleration_y(0);
+ physic.enable_gravity(true);
+ set_state (STATE_FALLING);
+
+ /* Create a new snowball where the snowman's head was */
+ /* TODO: Pass on our "dead_script" to the snowball. */
SnowBall* snowball = new SnowBall(snowball_pos, dir);
- remove_me();
Sector::current()->add_object(snowball);
- // bounce
- Player* player = dynamic_cast<Player*>(&object);
- if (player) player->bounce(*this);
-/*
- sprite->set_action(dir == LEFT ? "squished-left" : "squished-right");
- kill_squished(object);
-*/
return true;
}