Multiple Animation Instances
Posted: Thu Nov 26, 2009 12:58 pm
I want to spawn/de-spawn several animated objects on screen with random interval.
And then draw, would make the animations sync.
My initial idea was that I could use something like:
Myobject .. Var = love.graphics.newAnimation(Object_img, 32, 32, 1)
It looks to me that unless LUA/LÖVE are capable of generic naming of objects, one would have to use the following:
Problem with this is that 1) limited by how many objects you predefine 2) it's not very efficient/practical
Sure if I only had to make <10 objects it would be manageable, but lets say I wanted more.
Code: Select all
MyObjects = love.graphics.newAnimation(Object_img, 32, 32, 1)
My initial idea was that I could use something like:
Myobject .. Var = love.graphics.newAnimation(Object_img, 32, 32, 1)
It looks to me that unless LUA/LÖVE are capable of generic naming of objects, one would have to use the following:
Code: Select all
MyObject1 = love.graphics.newAnimation(Object_img, 32, 32, 1)
MyObject2 = love.graphics.newAnimation(Object_img, 32, 32, 1)
MyObject3 = love.graphics.newAnimation(Object_img, 32, 32, 1)
etc
Sure if I only had to make <10 objects it would be manageable, but lets say I wanted more.