You don't need sprites... just limit it's movement by doing checks of where the player is before allowing it to move.
` Make a character
ink rgb(0,255,0),0
box 0,0,25,25
get image 1,0,0,25,25,1
` Change the color for the limit box
ink rgb(255,0,0),0
` Starting x and y of the sprite
px=100:py=100
do
` Show the sprite
sprite 1,px,py,1
` Show a box that represents the limits below
box 100,100,540,380
` Up
if upkey() and py-1=>100
dec py
endif
` Down
if downkey() and py+26=<380
inc py
endif
` Left
if leftkey() and px-1=>100
dec px
endif
` Right
if rightkey() and px+26=<540
inc px
endif
loop