No, there's a *big* difference between your code and mine.
You are showing a frame of the image, doing a wait, showing the next frame, doing a wait...
You'll not be able to animate or move anything else at the same time in this way.
To see what I mean, take this slightly modified version of my code:
sync on
sync rate 40
rem Load hero sprite facing LEFT (1-3)
load image "heroanim1.bmp",1
load image "heroanim2.bmp",2
load image "heroanim3.bmp",3
rem Load hero sprite facing RIGHT (4-6)
load image "heroanim4.bmp",4
load image "heroanim5.bmp",5
load image "heroanim6.bmp",6
rem Set initial values for Variables
heroX=320
heroY=240
herostance=2
heroface=0
otherheros=1
rem Set default display of hero sprite (Sprite 1)
sprite 1,heroX,heroY,herostance
rem Main loop
do
rem Evaluate variables
heroX=sprite X(1)
heroY=sprite Y(1)
rem Left movement
if leftkey()=1
heroX=heroX-2
heroface=0
herostance=herostance+1
if herostance > 3 then herostance=1
endif
if rightkey()=1
heroX=heroX+2
heroface=1
herostance=herostance+1
if herostance > 3 then herostance=1
endif
otherheros=otherheros+1
if otherheros > 3 then otherheros=1
sprite 1, heroX, heroY, herostance+(heroface*3)
sprite 2, 0, 0, otherheros
sprite 3, 600, 400, otherheros+3
rem Refresh screen
sync
loop
Now my program is animating one sprite when the left/right keys are pressed, and two others are animating non-stop.