In my quest to make me game, i have added a menu, and some levels. the problem lies with the menu still being active(i can see it in the background) when i load a level. I am currently using something like this
if level==1 then
dofile("level1.lua")
elseif level==2 then
dofile("level2.lua")
...etc.
end
when i select my level, it loads the level fine but from a wallpaper error you can see my menu still going on in the background. my concern is that this will make my game slow down. what function should i use instead of "dofile"? or what function should i use to cease the menu from opperating?