sonic-radiance/sonic-radiance.love/game/events/event/teleport.lua

24 lines
768 B
Lua
Raw Normal View History

2021-04-03 00:04:22 +02:00
local StepParent = require "game.events.event.parent"
local SimpleMessageStep = StepParent:extend()
2021-05-05 08:30:32 +02:00
local defTransitions = require "birb.modules.transitions"
2021-04-03 00:04:22 +02:00
function SimpleMessageStep:new(controller, args)
SimpleMessageStep.super.new(self, controller, args)
end
function SimpleMessageStep:start()
local charDir = self.arguments.charDir
if (charDir == "default") then
charDir = self.events.scene.world.players[1].actor.charDir or "down"
end
2021-04-03 00:04:22 +02:00
core.screen:startTransition(defTransitions.default, defTransitions.default,
function() self.events.scene.world:teleport(self.arguments.area, self.arguments.x, self.arguments.y, charDir) end,
2021-04-03 00:04:22 +02:00
0, 0)
end
function SimpleMessageStep:update(dt)
self:finish()
end
return SimpleMessageStep;