Change animation speed

SGDK only sub forum

Moderator: Stef

Post Reply
orlanrod
Very interested
Posts: 99
Joined: Fri Sep 25, 2015 7:46 pm

Change animation speed

Post by orlanrod » Fri Oct 02, 2015 12:37 am

How would i initialize each animation to its own speed? Right now using the "SPRITE jason_sprite "jason.png" 2 3 -1 10" applies to all animations.

Thanks

nolddor
Very interested
Posts: 102
Joined: Sun Jun 02, 2013 1:35 pm
Location: Spain

Re: Change animation speed

Post by nolddor » Fri Oct 02, 2015 6:51 am

You need to set general speed in rescomp.res as zero, and use setAnimation / setFrame functions on SpriteEngine to animate the sprite on your own.
Last edited by nolddor on Fri Oct 02, 2015 12:56 pm, edited 1 time in total.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Change animation speed

Post by Stef » Fri Oct 02, 2015 9:13 am

rescomp is definitely not flexible enough when it comes to the SPRITE resource... you can modify generated structures afterward but that is dangerous as rescomp may overwrite them as soon you modify the .res file.
As suggested nolddor, the best is to let the "timer" parameter set to -1 in the SPRITE resource definition then handle it on your own.
In future i really want to have a real and good Sprite animation builder tool which will let you to tune the different parameters in depth...

nolddor
Very interested
Posts: 102
Joined: Sun Jun 02, 2013 1:35 pm
Location: Spain

Re: Change animation speed

Post by nolddor » Fri Oct 02, 2015 12:55 pm

Is there any difference between setting speed to -1 or zero?

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Change animation speed

Post by Stef » Fri Oct 02, 2015 2:08 pm

Actually i was wrong and you were correct :p
time parameter has to be set to 0 to avoid auto animation, -1 is not a valid value :p

orlanrod
Very interested
Posts: 99
Joined: Fri Sep 25, 2015 7:46 pm

Re: Change animation speed

Post by orlanrod » Fri Oct 02, 2015 8:32 pm

nolddor wrote:You need to set general speed in rescomp.res as zero, and use setAnimation / setFrame functions on SpriteEngine to animate the sprite on your own.
Ah okay. Yeah, now i got it working.
Thanks! 8D

orlanrod
Very interested
Posts: 99
Joined: Fri Sep 25, 2015 7:46 pm

Re: Change animation speed

Post by orlanrod » Fri Oct 02, 2015 8:35 pm

Stef wrote:rescomp is definitely not flexible enough when it comes to the SPRITE resource... you can modify generated structures afterward but that is dangerous as rescomp may overwrite them as soon you modify the .res file.
As suggested nolddor, the best is to let the "timer" parameter set to -1 in the SPRITE resource definition then handle it on your own.
In future i really want to have a real and good Sprite animation builder tool which will let you to tune the different parameters in depth...
Oh, you made SGDK? Cool. Pressure is on to make a cool game. 8D xD

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Change animation speed

Post by Stef » Fri Oct 02, 2015 9:56 pm

Haha, definitely you don't need to pressure yourself, it's already a pleasure to see new people using it =)

Post Reply