#include "trigger/climbable.hpp"
#include "object/player.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
#include "supertux/object_factory.hpp"
#include "util/gettext.hpp"
#include "util/reader.hpp"
const float POSITION_FIX_AY = 50; // y-wise acceleration applied to player when trying to align player and Climbable
}
-Climbable::Climbable(const Reader& reader)
- : climbed_by(0)
+Climbable::Climbable(const Reader& reader) :
+ climbed_by(0),
+ activate_try_timer()
{
reader.get("x", bbox.p1.x);
reader.get("y", bbox.p1.y);
bbox.set_size(w, h);
}
-Climbable::Climbable(const Rect& area)
- : climbed_by(0)
+Climbable::Climbable(const Rectf& area) :
+ climbed_by(0),
+ activate_try_timer()
{
bbox = area;
}
if (climbed_by) {
context.push_transform();
context.set_translation(Vector(0, 0));
- Vector pos = Vector(0, SCREEN_HEIGHT/2 - normal_font->get_height()/2);
- context.draw_center_text(normal_font, _("Up we go..."), pos, LAYER_GUI, Climbable::text_color);
+ Vector pos = Vector(0, SCREEN_HEIGHT/2 - Resources::normal_font->get_height()/2);
+ context.draw_center_text(Resources::normal_font, _("Up we go..."), pos, LAYER_HUD, Climbable::text_color);
context.pop_transform();
}
}
return true;
}
-IMPLEMENT_FACTORY(Climbable, "climbable");
-
/* EOF */