Failing to Restart A Game

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
bonez001
Prole
Posts: 36
Joined: Wed Sep 14, 2016 8:14 am

Failing to Restart A Game

Post by bonez001 »

I made my main.lua file like this

function NoLove()
--love.load= nil


love.draw = nil
love.joystickpressed = nil
love.joystickreleased = nil
love.keypressed = nil
love.keyreleased = nil
--love.load = nil
love.mousepressed = nil
love.mousereleased = nil
love.update = nil
end

state = {}
function loadState(name)
state = {}
NoLove()

require(name)
load()
end

function load()
end


--Loading another main
function love.load()


loadState("states/zero/main")
end


and I made another two main.lua files (A and B) as game states. The A lua is where the game begins. The second lua has a button where it points to A lua. WHen I run it. It seems like the reset button go back to B states again meaning it never resets and the output is the same.
Post Reply

Who is online

Users browsing this forum: No registered users and 227 guests