In your love.load() you'll want to assign a variable like "currentImage"
In your love.draw() you want to draw your currentImage
Code: Select all
love.graphics.draw(currentImage, 0, 0)
Then you'll need a callback to load.update(dt)
There you can assign the current time to a local variable.
Then, in an if statement, you can check to see if a certain amount of time has passed, and if so, you can change your currentImage
Something like:
Code: Select all
love.update(dt) -- The dt is the time which has passed since this was last called. Probably we don't need this right now.
local oldTime = love.timer.getTime()
if (love.timer.getTime() >= oldTime + 1) then -- I believe the 1 should stand for one second, in this case. Is the new time 1 second more than the old time?
currentImage = staticB
end
That would switch out A for B after 1 second. To switch back and forth, you would add another if statement in that block. To shuffle through all of the images, add them to a table and interate through it!
Hope this helps. I'm not a programmer, so there is probably a bug, but this is the basic idea.