Page 1 of 1

360 degree rotating actor

PostPosted: Thu Apr 26, 2007 2:35 am
by d-soldier
... I've changed some actor animations from a 24 frame animation to 36 (for 360 degree rotating objects) but it seems now that though the objects do rotate to face the desired target, the flicker back and forth between two frames... I've tried: (draw actor)

animpos = nframes*direction(x,y, player.x, player.y)/360.0;

&

angle=direction(x,y,player.x,player.y);
animpos=angle/360*nframes;

So whats the deal!?! My frames (filenames) range from XXXX_01.png - XXXX_36.png
I thought that frame 36 is actually the same as 1, so I tried deleting it and using 35 frames (just in case) but nothing seemed to change... Anyone?

PostPosted: Thu Apr 26, 2007 3:26 pm
by Troodon
If your first frame would be XXXX_00.png you would need 35. But if it's XXXX_01.png you need 36 frames.

PostPosted: Thu Apr 26, 2007 4:38 pm
by d-soldier
tekdino wrote:If your first frame would be XXXX_00.png you would need 35. But if it's XXXX_01.png you need 36 frames.


I tried both to be sure, the animation still cant seem to stay on a single frame (even when not moving) it flickers between two frames. Since I am coming from a 25 frame roation (to 36) there must be something in the code thats wrong. Anyone>?

PostPosted: Fri Apr 27, 2007 4:49 am
by Troodon
I had that problem!
It comes only when you don't move isn't it?
Try the code
xvelocity = 0;
yvelocity = 0;
when the actor isn't moving.
I hope that helps. :)

funny thing...

PostPosted: Fri Apr 27, 2007 3:34 pm
by d-soldier
The solve for this problem is IN THE FILE NAMES!.. Is that a bug then? The file names were:

BossGun2_360_0001.png (and so on through 36)

and things work now that I changed them to:

BossGun_0001.png (and so on through 36)...

Very strange behavior... And why does this topic always say "no posts" when I click on it!?!

PostPosted: Fri Apr 27, 2007 6:19 pm
by Sgt. Sparky
xD
I think it is a glitch! xD