MZ How can I make a loop with variable number+1 each time?

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.
Hmmm, if your array is like in $gameVariables.value(1), then get the array values with like
$gameVariables.value(1)[$gameVariables.value(2)]
That variable 2 starts at 0 and then inside the loop you increase it by 1 so when the loop runs again it picks the next index.

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-make-a-loop-with-variable-number-1-each-time.175168/