I wanna make scene system. I searched and found hump and now i am using gamestate of hump. it is good.
but there is a problem, in scene transitions, old scene does not disappear.
how can i achieve this..
Code: Select all
require "livecode"
local Gamestate = require "gamestate"
require "gooi"
local oyun = {}
local anamenu = {}
function love.load()
Gamestate.switch(anamenu)
end
function love.mousepressed(x, y, button) gooi.pressed() end
function love.mousereleased(x, y, button) gooi.released() end
function love.touchpressed(id, x, y) gooi.pressed(id, x, y) end
function love.touchreleased(id, x, y) gooi.released(id, x, y) end
function love.draw()
gooi.draw()
end
function anamenu:enter()
lbl1 = gooi.newLabel("burası ana menü", 10, 10)
btn1 = gooi.newButton("oyuna git", 220, 40, 250, 25)
:bg({255, 0, 0})
:onRelease(function()
Gamestate.switch(oyun)
end)
end
function anamenu:update(dt)
end
function anamenu:draw()
gooi.draw()
end
--------------------------------------
function oyun:enter()
pGame = gooi.newPanel(350, 10, 420, 270, "game")
pGame:add(gooi.newButton("Bomb"), "b-r")
end
function oyun:update(dt)
end
function oyun:draw()
gooi.draw()
end