I'm making an action sequence that punches 4 times, and each time the actor moves different distance.
It's like:
Punch 1 - no move (x=0)
Punch 2 - move forward by 30 pixel (x = +30)
Punch 3 - move backward by 60 pixel (x = -60)
Punch 4 - move forward by 30 pixel (x = +30)
The distance x would be 0, 30, -60, 30, and apparentlly I can't use x += 30.
I'm thinking to store them in an array or simply in 4 variables,
but I found I don't know how I can use loop with the varible number(or array index) increasing 1 each time.
Any help is appreciated.
It's like:
Punch 1 - no move (x=0)
Punch 2 - move forward by 30 pixel (x = +30)
Punch 3 - move backward by 60 pixel (x = -60)
Punch 4 - move forward by 30 pixel (x = +30)
The distance x would be 0, 30, -60, 30, and apparentlly I can't use x += 30.
I'm thinking to store them in an array or simply in 4 variables,
but I found I don't know how I can use loop with the varible number(or array index) increasing 1 each time.
Any help is appreciated.