Page 1 of 1

SPRITE FLIP

Posted: Tue May 05, 2026 2:53 pm
by davey110
I find that SPRITE N$ FLIP K does not work. I had to make a new sprite.

Re: SPRITE FLIP

Posted: Fri May 08, 2026 12:15 pm
by Dutchman
I tested the sample program from the PDF manual on page 54:

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 DEF
The program uses following image:
submarine 1.png
submarine 1.png (10.15 KiB) Viewed 194 times
The submarine flips as expected.
Probably the sprite needs to be be generated from an image file.