a few fixes that I had lying around here, select walk animation in worldmap when...
[supertux.git] / src / object / scripted_object.hpp
1 #ifndef __SCRIPTED_OBJECT_H__
2 #define __SCRIPTED_OBJECT_H__
3
4 #include <string>
5 #include "physic.hpp"
6 #include "sprite/sprite.hpp"
7 #include "lisp/lisp.hpp"
8 #include "moving_object.hpp"
9 #include "scripting/scripted_object.hpp"
10
11 class ScriptedObject : public MovingObject, public Scripting::ScriptedObject
12 {
13 public:
14   ScriptedObject(const lisp::Lisp& lisp);
15   virtual ~ScriptedObject();
16
17   void update(float elapsed_time);
18   void draw(DrawingContext& context);
19   HitResponse collision(GameObject& other, const CollisionHit& hit);
20
21   // --- Scripting Interface stuff ---
22
23   void set_animation(const std::string& animation);
24   std::string get_animation();
25
26   void move(float x, float y);
27   void set_pos(float x, float y);
28   float get_pos_x();
29   float get_pos_y();
30   void set_velocity(float x, float y);
31   float get_velocity_x();
32   float get_velocity_y();
33   void set_visible(bool visible);
34   bool is_visible();
35
36   std::string get_name();
37
38 private:
39   std::string name;
40   bool solid;
41   bool physic_enabled;
42   bool visible;
43   bool new_vel_set;
44   int layer;
45   Vector new_vel;
46   Physic physic;
47   Sprite* sprite;
48 };
49
50 #endif
51