Here's my code, it may help you understand what I'm asking help on. In my code, you will see one lua.graphics.setColor, I want the second one to be under the finish1_draw() function, so all the "walls" will be 158, 158, 158 (gray), and the finishline will be a different color.
My code:
Code: Select all
finishline = love.graphics.newImage("Images/finish.png")
function level1_draw()
love.graphics.rectangle("fill", 410, 150, 40, 350) --Left Wall
love.graphics.rectangle("fill", 490, 150, 40, 350) --Right Wall
love.graphics.rectangle("fill", 410, 150, 120, 40) --Top Wall
love.graphics.rectangle("fill", 410, 500, 120, 40) --Bottom Wall
love.graphics.setColor(158, 158, 158)
if player.x < 451 or
player.x > 465 or
player.y < 191 or
player.y > 474 then
player.x = startPosX
player.y = startPosY
end
function finish1_draw()
love.graphics.draw(finishline, 458, 200)
end
end