NeutronLoved/objects/end.lua
2022-03-10 09:39:17 +01:00

26 lines
579 B
Lua

local gen= {}
function gen:new(game,winner)
local End = game.objects.base:new(game,0,0,0,0)
local folder = "win"
if game.OSTYPE=="Mobile" then folder = "winmobile" end
End.sprite = game:newImage("text/"..folder.."/"..winner..".png")
End:register("End")
function End:step(dt) end
function End:draw()
lg.draw(self.sprite,(self.game.WIDTH-self.sprite:getWidth())/2,(self.game.HEIGHT-self.sprite:getHeight())/2)
end
function End:MouseCallback(x,y)
local t = self.game.objects.transition:new(game,0.5,"main")
self.game:summon(t)
end
return End
end
return gen