[60F0609000000000]→Pic01
.standing still
[6070609000000000]→Pic01R
[6070E02000000000]
[6070704000000000]
[etc]
.running right
[60E0609000000000]→Pic01L
[60E0704000000000]
[60E0E02000000000]
[etc again]
.running left
.start main loop etc
If getkey(2) xor (getKey(3))
.if either left or right (not both, only one) is pressed
getKey(2)*2+getKey(3)→A
.if left is pressed, 2 is stored to A; otherwise 1 is stored
B++>>7?-1→B
.Add one to B. If the result is greater than 7, then store 0 to B.
.to use with animation of different # of frames, change the number in [B++>>#] to (# of frames *2 -1)
.(B is the frame counter, this animation is 4 frames...counting from zero B can have 8 values)
Else
→A→B
.if neither of the keys is pressed store 0 to both A and B
End
Pt-On(X,Y,(A-1*32+(B/2*8)+8*(A/=0)+Pic01))
...
"/=" is not equal to
Pt-On(X,Y,
:P
(A-1*32
sets pointer to either the start of sprites depicting running left or running right
to work with animations of a different # of frames, modify the number multiplied by (# of frames *8)
+(B/2*8)
sets pointer to specific frame
+8
pointer was offset from first sprite, this fixes the offset to point to the start of the animations
*(A/=0)
only animate if it's supposed to
+Pic01))
pointer to sprites
...
.dispgraph stuff, end loop