- sprite->draw(context, Vector(area.x, area.y), LAYER_TILES);
+ if(animation_timer.check())
+ context.draw_surface(door_opening[(animation_timer.get_gone() * DOOR_OPENING_FRAMES) /
+ DOOR_OPENING_TIME], Vector(area.x, area.y - (door_opening[0]->h/2)), LAYER_TILES);
+ else
+ door->draw(context, Vector(area.x, area.y), LAYER_TILES);
+
+ //Check if door animation is complete
+ //TODO: Move this out of the "draw" method as this is extremely dirty :)
+ if ((!animation_timer.check()) && (door_activated)) {
+ door_activated = false;
+ GameSession::current()->respawn(target_sector, target_spawnpoint);
+ }