function love.load()
playerState = ghost
normalText = "Player State is Normal"
ghostText = "Player State is Ghost"
end
function love.draw()
if playerState == normal then
love.graphics.print(normalText, 10, 10)
end
if playerState == ghost then
love.graphics.print(ghostText, 10, 10)
end
end
However, upon running this it displays both pieces of text at once, no matter the value of playerState. I'm sure this is such a simple error, but I'm very new to Lua and LOVE.
If somebody could point me in the direction of where I am going wrong and how to correct it, I will be very thankful.
function love.load()
playerState = "ghost"
normalText = "Player State is Normal"
ghostText = "Player State is Ghost"
end
function love.draw()
if playerState == "normal" then
love.graphics.print(normalText, 10, 10)
end
if playerState == "ghost" then
love.graphics.print(ghostText, 10, 10)
end
end