4 #include "video/drawing_context.h"
7 #include "special/sprite_manager.h"
9 #include "lisp/writer.h"
11 Platform::Platform(const lisp::Lisp& reader)
13 sprite = sprite_manager->create("flying_platform");
14 movement = Vector(0, 1);
15 reader.get("x", bbox.p1.x);
16 reader.get("y", bbox.p1.y);
17 bbox.set_size(sprite->get_width(), sprite->get_height());
30 Platform::collision(GameObject& , const CollisionHit& )
33 if(typeid(object) == typeid(Player)) {
34 Player* player = (Player*) &object;
35 //player->movement += movement;
42 Platform::action(float )
44 // just some test code...
46 movement = Vector(0, 1);
51 movement = Vector(0, -1);
56 movement = Vector(1, 0);
61 movement = Vector(-1, 0);
66 movement = Vector(-1, 1);
73 Platform::draw(DrawingContext& context)
75 sprite->draw(context, get_pos(), LAYER_OBJECTS);