So I familiarizing myself with Löve2D and lua again and right now I have a small project where I want to randomize the background color (for fun) and this is what I currently have:
Put backgroundcolor = {love.math.random(0,255),love.math.random(0,255),love.math.random(0,255)} in love.load, and pass backgroundolor into love.graphics.setBackgroundColor as a parameter.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
joedono wrote: ↑Wed Feb 22, 2017 8:21 pm
love.draw() is called every frame. If you put the code that zorg gave you in there, it should produce the seizure-inducing effect you want.
Well then I must be missing something because right now it only changes color once when I run the program the first time:
function love.load()
-- Cake stuff
cake = love.graphics.newImage("cake.png")
pos1 = 400
pos2 = 400
rad = 0
scaleX = 1
scaleY = 1
originX = 120
originY = 104
end
function love.draw()
-- Background Stuff
-- also, it doesn't really matter what you call the variable.
backgroundcolor = {love.math.random(0,255),love.math.random(0,255),love.math.random(0,255)}
love.graphics.print("Hello World", 370, 200)
love.graphics.setBackgroundColor(backgroundcolor)
love.graphics.draw(cake, pos1, pos2, rad, scaleX, scaleY, originX, originY)
end
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.