_Title "Walking Man trans by bplus started 2018-06-30" 'QB64 version 2017 1106/82 (the day before they switched to version 1.2)
walk&
= _LoadImage("walking720x146.png") ' 8 positions at 90 x 146 walk& is same as slot numbermanW = 90 'width of man image
manH = 146 'height of man image
manN = 0 'man number 0 to 7 as walks ie, manN = (manN + 1) mod 8
manY = (ymax - manH) \ 2 'place top man image at manY always as walks across the screen
manX = -manW 'start off screen by 1 manW manX is x location on screen of man
' blt(1, x*90, 0, 90, 146, movex, 45)
'
' blt(sprite number,starting x position, starting y position, image width, image height, destination x, and y)
'
' (I prefer a strip of characters. Others may use a 'grid' of characters.)
'
' Sprite #1 is the 'walking' strip of characters
'
' when x = 0 it will grab the first image locate at x*90 with a width of 90px and a height of 146px
' and display it at 'movex'x and 45y. Perform a short delay; increment to the next image; If the
' image grabbed is greater than 7 (the last image) then reset the image count to 0 (first image).
' move the curent image 5 pixels to the right. If the image moves off screen, make it reappear on
' the other side. Continue doing this until the escape key is pressed.
'' _PUTIMAGE [STEP] [(dx1, dy1)-[STEP][(dx2, dy2)]][, sourceHandle&][, destHandle&][, ][STEP][(sx1, sy1)[-STEP][(sx2, sy2)]][_SMOOTH]
'THE SKINNY: (notice the unintuitive positions of source handle and destination handle)
'destination coordinates: (x, y)-(x2, y2) <<<< syntax
'then source (image) handle (walk),
'then destination handle = 0 for screening, then coordinates of image in
'finally source coordinates off image of image handle: (x, y)-(x2, y2) <<<< syntax
manN
= (manN
+ 1) Mod 8 'increase image index until hit 7 then back to 0 manX = manX + 10
If manX
>= xmax
Then manX
= -manW
'move man back to left side of screen when hit right side _Limit 10 'like wait(100) this limits displays to 10 per second