Baxslash,
This is the test I've done, and here I manually set the frame in the main loop. This works, but Then I don't have the luxury of setting the
speed of the animation with playsprite.
LoadImage(1,"Climb.Png")
CreateSprite(1,1)
SetSpriteAnimation(1,223,267,16)
SetSpritePosition(1,0,300)
setSpriteFrame(1,1)
CFrame=1
do
if CFrame<16
CFrame=CFrame+1
SetSpriteFrame(1,CFrame)
else
setSpriteFrame(1,1)
CFrame=1
endif
if CFrame=1
setSpritePosition(1,GetSpriteX(1)+38,GetSpriteY(1)-32)
endif
if CFrame=9
setSpritePosition(1,GetSpriteX(1)+89,GetSpriteY(1)-32)
Endif
sync()
loop
This is the test with playsprite that didnt work for me:
LoadImage(1,"Climb.Png")
CreateSprite(1,1)
SetSpriteAnimation(1,223,267,16)
SetSpritePosition(1,0,300)
setSpriteFrame(1,1)
CFrame=1
playsprite(1,4)
do
if getspriteCurrentFrame(1)=1 and CFrame=1
setSpritePosition(1,GetSpriteX(1)+38,GetSpriteY(1)-32)
CFrame=2
elseif getspriteCurrentFrame(1)=9 and CFrame=2
setSpritePosition(1,GetSpriteX(1)+38,GetSpriteY(1)-32)
Cframe=1
endif
sync()
loop
So now I have 2 questions -
1:
In the first example - how do Control the speed of the animation without influencing the speed of the mainloop?
2:
In the second example I use CFrame to make sure the sprite isn't moved more than one time at a certain frame - but the frame is still shown at the wrong position a short momemt before it is moved. How do I fix this?