NeutronLoved/objects/end.lua

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.7,"main")
self.game:summon(t)
end
return End
end
return gen