Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Animate sprite? Best way / practice ? — Gideros Forum

Animate sprite? Best way / practice ?

Hello,
I am here through to question a thing: can anyone tell what is the best practice or way to animate sprite? When I want to animate on colision, or whatever I need to do??
I've tried some ways to do it like using movie clip, or manipulating on frame changes (add/remove child) but I couldn't get a best way to do this... If I use movie clip, it doesn't load all my sprites and later starts to get hardly lagged, I just cannot use movie clip... any idea?
Tagged:

Comments

  • if you want to do a frame-by-frame animation then movieclip should be the thing to do though, try it harder. perhaps it lags for you because you make a new movieclip for each playing of the animation? for one sprite make only one movieclip which you can replay whenever needed.
    in any case a movieclip example in gideros studio would be nice.
  • Hello! Thanks for the answer!
    Maybe that would be so... I'll try It over again
  • I am trying this way:
    if self.shipDamaged then
    		self.mc:gotoAndPlay(1)
    		self:addChild(self.mc)
    		self.shipDamaged = false
    	else
    It at least didn't lag any more, but the matter is that the sprite doesn't changes... It remain one alone throughout the animation...
    self.mc = MovieClip.new {
    		{1, 1, self.animDamage[1]},
    		{2, 2, self.animDamage[2]},
    		{3, 3, self.animDamage[3]},
    		{4, 4, self.animDamage[4]},
    	}
  • your code looks fine for me at first sight. did you double check that in yout self.animDamage table you have different images?

    Likes: Paulo777

    +1 -1 (+1 / -0 )Share on Facebook
  • Paulo777Paulo777 Member
    edited February 2018
    @keszegh of course!, actually I have a texture packer set... but It just loads the first frame... I thought It was due to the movie clip is not inside an event but I've placed it inside and outside but nothing! all of them has the same result
  • Hello! I got it to working!
    @keszegh , as I've set
    self.mc:gotoAndPlay(1)
    , as the
    (1)
    was set, initially I thought that it'd run all my frames, but as I didn't set a "goto action" like looping, it runs only the designated frame, :)
  • i'm not sure i understand what was the problem, but i'm glad you managed to sort it out.
Sign In or Register to comment.