ALSO SORRY FOR HAVING SUCH MESSY CODE.
I've been trying to make a space invader like game for practice, but for some reason, when I enter the gameover gamestate, I cant change back to the playing gamestate when i press R.
My gamestate system is just a string, so if you die for example your gamestate turns into "gameover" or if you're playing the gamestate is by default "playing". Now the thing is I've added a code where if you're in the game over state, you will go back to the playing gamestate via pressing R. This for some reason doesnt work.
Code goes like this
Code: Select all
elseif gamestate == "gameover" then
if love.keyboard.isDown("r") then
gamestate = "playing"
end
Also my second problem is the fact that my particles dont disappear even after adding in a system that removes the particle table when it reaches a certain tick point.
Code: Select all
function particle_systems:cleanup()
if particlelimit <= 0 then
table.remove(particle_systems.list)
particlelimit = 220
end
end