Something like this
bg=loadimage("background.png")
touchimage=loadimage("image.png")
bgSpr=createSprite(bg)
SetSpritePosition(bg,0,0)
SetSpriteDepth(bgSpr,10)
global touchSpr=createSprite(touchImage)
SetSprPosition(touchSPr,random(1,GetVirtualWidth() =GetSpriteWidth(touchSpr)),random(1,GetVirtualHeight() =GetSpriteHeight(touchSpr)))
SetSpriteDepth(bgSpr,1)
rem set up things before time starts here .......................
time#=timer()
repeat
if getpointerpressed()=1
mx#=GetPointerX()
my#=GetPointerY()
Hit=GetSpriteHit( mx#, my# )
if hit=bg then time# = time#-1
if hit=touchSpr
rem set another sprite image to touchSpr then re position
rem startGame(time#) :rem or startGame(time#,touchSpr) depending how you declared the function
endif
endif
until timer()-time#>1000
rem 1000 seconds have elapsed end program
function startGame(time# as float)
rem If touchSpr is global then can SetSprPosition(touchSPr,random(1,GetVirtualWidth() =GetSpriteWidth(touchSpr)),random(1,GetVirtualHeight() =GetSpriteHeight(touchSpr)))
rem if you don't want touchSpr global you could declare the function function startGame(time# as float,touchSpr as integer)
rem timer-time# equals the time it took to press the sprite minus any penalties by pressing bgSpr
rem do what you want once touch sprite is pressed
endfunction
fubar