Page 1 of 1

Failing to Restart A Game

Posted: Mon Sep 26, 2016 5:59 am
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.