Hello forums! I have a question that is so basic you'll probably laugh at it, but I know you will help:
How do I get more than one of the same sprite. And don't say repeatedly doing
(sprite) = Bitmap.new(Texture.new("ship.png"))
stage:addChild(playership1) |
I mean writing one piece then if you were to say do:
It would change the scale of all the sprites.
Thanks in advance.
Edit: BTW The sprite is being made in an animation and ideally I would like all childs of the sprite to be animated.
Animate code:
local anim1 = {}
anim1[1] = Bitmap.new(Texture.new("invader2.png"))
anim1[2] = Bitmap.new(Texture.new("invader.png"))
local animation = MovieClip.new{
{1,40, anim1[1]},
{40,100, anim1[2]},
anim1[1]:setScale(0.3)
}
animation:setPosition(0,-5)
stage:addChild(animation)
animation:setGotoAction(100, 1)
animation:gotoAndPlay(1) |
Comments
I leave to you the code to place them on different lines
Thanks for your time!