lol oh ok i see yes form functions were my insperation for this but i'm having a problem i just wrote this up and it's pasting the sprite but the x position of sprite one every time is off by some actually the higher the initial x position the bigger difference between where it should be and where it is. heres the code.
Edit:
wait no it does the offset by witch Makesprite function is called first. when sprite 2 is called first that one is offset if sprite 1 is called first then it is offset hmmmm i don't get it lol
Edit2:
Never mind i put the part where it sets SpriteX(Sprite)=X and spriteY(Sprite)=Y at the beginning of the function and it works i also added a Spritetofront function

heres the new code
remstart
-------------------------------------------------------------------
program name:Sprite Priority Functions
-------------------------------------------------------------------
written by: Caleb Stewart
date:
-------------------------------------------------------------------
comments:
-------------------------------------------------------------------
remend
Sync on
Sync rate 0
WinX=(640/2)/2+25
WinY=(480/2)/2+25
Set window on
Set window position WinX,WinY
Dim sprites(1000,2)
Dim Priority(1000)
Dim SpriteX(1000)
Dim SpriteY(1000)
Dim NumSprites(0)
ink rgb(255,255,255),0
box 0,0,32,32
get image 1,0,0,32,32
Ink RGB(0,0,255),0
box 0,0,32,32
get image 2,0,0,32,32
Makesprite(2,16,0,1,1)
Makesprite(1,0,0,2,0)
SpriteToFront(1)
Do
Showsprite
text 300,300,Str$(SpriteX(1))+","+Str$(SpriteX(2))
Sync
Cls
Loop
Function MakeSprite(Sprite,X,Y,Image,Top)
SpriteX(Sprite)=X
SpriteY(Sprite)=Y
NumSprites(0)=NumSprites(0)+1
Sprites(Sprite,1)=Sprite
Sprites(Sprite,2)=Image
if top>0
For X=1 to NUmSprites(0)
if priority(X)=1 then priority(X)=0
next x
priority(Sprite)=1
else
priority(sprite)=0
endif
endfunction
Function spriteToFront(Sprite)
For X=1 to numsprites(0)
if priority(X)=1 then priority(X)=0
next x
Priority(Sprite)=1
endfunction
Function ShowSprite()
for X=1 to Numsprites(0)
if priority(X)!1
Sprite Sprites(X,1),SpriteX(X),SpriteY(X),Sprites(X,2)
else
Priority=X
endif
next x
sprite Sprites(Priority,1),SpriteX(Priority),SpriteY(Priority),Sprites(Priority,2)
endfunction