PinPong 2D Animation?

Started by Amon, March 02, 2023, 15:29:32

Previous topic - Next topic

Amon

Can anyone share some code on how I could make my anims pinpong i.e. when it reaches the last frame it goes backwards to the first frame? 

Derron

framePos :+ direction
if framePos >= frameCount then direction = -1
if framePos <= 0 then direction = 1

something like this?


bye
Ron

Amon

QuoteframePos :+ direction

Oooh, I've never seen this. What exactly does it do?

Derron

it is the same as
framePos = framePos + direction



bye
Ron