In the update function, is there a function to overload setBackgroundColor?
Heres the Code that I have:
Code: Select all
Cor = coroutine.create(function()
while true do
local a = math.random(1,255)
local b = math.random(1,255)
local c = math.random(1,255)
coroutine.yield(a,b,c)
end
end)
function load()
Text = love.graphics.newFont(love.default_font,12)
love.graphics.setFont(Text)
Message = "Neverfly"
love.graphics.setBackgroundColor(200,0,0)
x = 50
y = 100
a,b,c = 0,0,0
end
function update(dt)
love.graphics.setBackgroundColor(coroutine.resume(Cor, a, b,c)) -- ERROR HERE!
if love.keyboard.isDown(love.key_right) then
x = x + 5
elseif love.keyboard.isDown(love.key_left) then
x = x - 5
end
if love.keyboard.isDown(love.key_up) then
y = y -5
elseif love.keyboard.isDown(love.key_down) then
y = y + 5
end
end
function draw()
love.graphics.draw("Y Value is: ["..x.."]", 1, 15)
love.graphics.draw("X Value is: ["..y.."]", 1, 30)
love.graphics.draw(Message, x, y)
end