countMe = false;
sound_manager->preload("sounds/yeti_gna.wav");
sound_manager->preload("sounds/yeti_roar.wav");
+ hud_head.reset(new Surface("images/creatures/yeti/hudlife.png"));
draw_dead_script_hint = false;
}
if(safe_timer.started() && size_t(game_time*40)%2)
return;
+ draw_hit_points(context);
+
BadGuy::draw(context);
}
void
+Yeti::draw_hit_points(DrawingContext& context)
+{
+ int i;
+
+ Surface *hh = hud_head.get();
+ if (!hh)
+ return;
+
+ context.push_transform();
+ context.set_translation(Vector(0, 0));
+
+ for (i = 0; i < hit_points; ++i)
+ {
+ context.draw_surface(hh, Vector(BORDER_X + (i * hh->get_width()), BORDER_Y + 1), LAYER_FOREGROUND1);
+ }
+
+ context.pop_transform();
+}
+
+void
Yeti::active_update(float elapsed_time)
{
switch(state) {
#ifndef __YETI_H__
#define __YETI_H__
+#include <memory>
+
#include "badguy.hpp"
class Yeti : public BadGuy
void kill_squished(GameObject& object);
void kill_fall();
- virtual Yeti* clone() const { return new Yeti(*this); }
+ virtual Yeti* clone() const { return new Yeti((Yeti&)*this); }
private:
void run();
void summon_snowball();
void jump_down();
+ void draw_hit_points(DrawingContext& context);
+
void take_hit(Player& player);
enum YetiState {
Timer safe_timer;
int stomp_count;
int hit_points;
+ std::auto_ptr<Surface> hud_head;
};
#endif