How to remove an image?
Posted: Sun Aug 09, 2015 6:39 am
So I need to remove an image and a song using an if statement. If gamestate = play then (Remove image,song)
Please Help
Code: Select all
gamestate = "title"
function love.update(dt)
mainmenu = love.graphics.newImage("back.jpg")
playbackground = love.graphics.newImage("playbackground.png")
music = love.audio.newSource( 'background.mp3', 'stream' )
music:setLooping( true ) --so it doesnt stop
music:play()
if gamestate == "title" then
if love.keyboard.isDown("return", "enter") then
gamestate = "play"
end
else
-- do your game logic here
end
end
end
function love.draw()
love.graphics.draw(mainmenu)
if gamestate == "title" then
love.graphics.print( "Press Enter To Play")
else
-- draw your game here
end
end
end
Please Help