Lol!
I answer the question, then someone else posts after me with
incorrect information and you ignore my post and thank them!
Quote: "The sprite order is fixed, you cannot change the order they are drawn to screen"
It's a good job I'm not easily upset isn't it!
Anyway, this code snippet might make things a little clearer...
Gosub Setup
Do
I$=Inkey$(): If I$<>"" Then Gosub ChangeOrder
Gosub MoveSprites
Gosub DrawSprites
Sync
Center Text 400,0,"Press 1 For Red On Top, 2 For Green On Top And 3 For Blue On Top"
Loop
End
ChangeOrder:
Rem Change Sprite Z-Order
Select I$
Case "1"
TopSprite=1
Ink Red,0
EndCase
Case "2"
TopSprite=2
Ink Green,0
EndCase
Case "3"
TopSprite=3
Ink Blue,0
EndCase
EndSelect
Return
MoveSprites:
Rem Red Sprite
Inc SpriteX1,XDir1
If SpriteX1<0 Then SpriteX1=0: XDir1=0-XDir1
If SpriteX1>Screen Width()-128 Then SpriteX1=Screen Width()-128: XDir1=0-XDir1
Rem Green Sprite
Inc SpriteX2,XDir2
If SpriteX2<0 Then SpriteX2=0: XDir2=0-XDir2
If SpriteX2>Screen Width()-128 Then SpriteX2=Screen Width()-128: XDir2=0-XDir2
Rem Blue Sprite
Inc SpriteX3,XDir3
If SpriteX3<0 Then SpriteX3=0: XDir3=0-XDir3
If SpriteX3>Screen Width()-128 Then SpriteX3=Screen Width()-128: XDir3=0-XDir3
Return
DrawSprites:
Select TopSprite
Case 1
Sprite 1,SpriteX3,140,3
Sprite 2,SpriteX2,120,2
Sprite 3,SpriteX1,100,1
EndCase
Case 2
Sprite 1,SpriteX1,100,1
Sprite 2,SpriteX3,140,3
Sprite 3,SpriteX2,120,2
EndCase
Case 3
Sprite 1,SpriteX1,100,1
Sprite 2,SpriteX2,120,2
Sprite 3,SpriteX3,140,3
EndCase
Endselect
Return
Setup:
Set Display Mode 800,600,16
Sync On: Sync Rate 0
CLS
Create Bitmap 1,320,200
Rem Make 3 Sprite Images - Red, Green and Blue
CLS RGB(255,0,0)
Get Image 1,0,0,128,128
CLS RGB(0,255,0)
Get Image 2,0,0,128,128
CLS RGB(0,0,255)
Get Image 3,0,0,128,128
Set Current Bitmap 0
Delete Bitmap 1
Rem Movement Variables
SpriteX1=100: SpriteX2=200: SpriteX3=300
XDir1=4: XDir2=4: XDir3=4: TopSprite=3
Red=RGB(255,0,0): Green=RGB(0,255,0): Blue=RGB(0,0,255)
Ink Blue,0
Rem Make the 3 Sprites
Sprite 1,SpriteX1,100,1
Sprite 2,SpriteX2,120,2
Sprite 3,SpriteX3,140,3
Return
TDK_Man