2022-03-04 14:34:54 +01:00
|
|
|
local gen= {}
|
|
|
|
|
|
|
|
function gen:new(game,winner)
|
|
|
|
|
|
|
|
local End = game.objects.base:new(game,0,0,0,0)
|
2022-03-09 16:25:29 +01:00
|
|
|
local folder = "win"
|
|
|
|
if game.OSTYPE=="Mobile" then folder = "winmobile" end
|
|
|
|
End.sprite = game:newImage("text/"..folder.."/"..winner..".png")
|
2022-03-04 14:34:54 +01:00
|
|
|
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)
|
2022-03-10 09:39:17 +01:00
|
|
|
local t = self.game.objects.transition:new(game,0.5,"main")
|
2022-03-09 11:04:28 +01:00
|
|
|
self.game:summon(t)
|
2022-03-04 14:34:54 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
return End
|
|
|
|
end
|
|
|
|
|
|
|
|
return gen
|