SPRITE FLIP
SPRITE FLIP
I find that SPRITE N$ FLIP K does not work. I had to make a new sprite.
- Dutchman
- Posts: 877
- Joined: Mon May 06, 2013 9:21 am
- My devices: iMac, iPad Air, iPhone
- Location: Netherlands
- Flag:

Re: SPRITE FLIP
I tested the sample program from the PDF manual on page 54:
The program uses following image:
The submarine flips as expected.
Probably the sprite needs to be be generated from an image file.
Code: Select all
'Example of repeated FLIP usage:
Sprite$="submarine 1.png"
sh=SCREEN_HEIGHT()
sw=SCREEN_WIDTH()
movex=3
GRAPHICS
OPTION SPRITE POS CENTRAL
SPRITE "a" LOAD Sprite$
SPRITE "a" DELAY 0.04
SPRITE "a" AT sw/2,sh/2
SPRITE "a" dX movex
SPRITE "a" SHOW
SPRITE "a" loop
DO
PAUSE 1
CALL ReverseSprite
GET TOUCH nn AS x,y
UNTIL x>-1
SPRITES DELETE
TEXT
END
DEF ReverseSprite ' Function to alternate flip
Flipped=(Flipped+1)%2
SPRITE "a" FLIP Flipped
SPRITE "a" dX .movex*(1-Flipped*2)
END DEFProbably the sprite needs to be be generated from an image file.
