MovingSprite(lisp, LAYER_OBJECTS, COLGROUP_MOVING_STATIC),
physic(),
name(),
- solid(true),
- physic_enabled(true),
- visible(true),
+ solid(true),
+ physic_enabled(true),
+ visible(true),
new_vel_set(false),
new_vel()
{
lisp.get("solid", solid);
lisp.get("physic-enabled", physic_enabled);
lisp.get("visible", visible);
- lisp.get("z-pos", layer);
+ layer = reader_get_layer (lisp, /* default = */ LAYER_OBJECTS);
if( solid ){
set_group( COLGROUP_MOVING_STATIC );
} else {
void
ScriptedObject::set_pos(float x, float y)
{
- printf("SetPos: %f %f\n", x, y);
- bbox.set_pos(Vector(x, y));
+ // printf("SetPos: %f %f\n", x, y);
+ MovingObject::set_pos(Vector(x, y));
physic.reset();
}
}
void
-ScriptedObject::set_visible(bool visible)
+ScriptedObject::set_visible(bool visible_)
{
- this->visible = visible;
+ this->visible = visible_;
}
bool
}
void
-ScriptedObject::set_solid(bool solid)
+ScriptedObject::set_solid(bool solid_)
{
- this->solid = solid;
+ this->solid = solid_;
if( solid ){
set_group( COLGROUP_MOVING_STATIC );
} else {
return solid;
}
+bool
+ScriptedObject::gravity_enabled() const
+{
+ return physic.gravity_enabled();
+}
+
+void
+ScriptedObject::enable_gravity(bool f)
+{
+ physic.enable_gravity(f);
+}
+
void
ScriptedObject::set_action(const std::string& animation)
{