To build on Slayer93's example, try the code below.
I suggest that you NEVER ever use Goto. It is one of the worse habits you can get into when you start learning to program and very difficult to get out of.
There are ALWAYS alternative ways to do something instead of using Goto!
Enjoy!
Set Display Mode 640,480,16
Sync On
CLS 0
Word$="Click Me"
TL = Text Width(Word$)+8
SecsToShow = 5
Lives = 5
Randomize Timer()
T = Timer()
Set Text Opaque
Gosub MoveWord: Rem Initially place the word
Do
Gosub TimerProc
Ink RGB(0,255,0),0
Center Text 320,0,"Points: " +Str$(points)+" Lives: " +Str$(Lives)+" Showing Word For " +Str$(SecsToShow)+" Seconds."
If Mouseclick()=1
If MouseX()>X And MouseY()>Y And MouseX()<X+TL And MouseY()<Y+16
Inc Points
Scored# = Points/10.0
If Scored# = Int(Scored#) and SecsToShow > 1
Dec SecsToShow: Rem Every 10 points display word for shorter time
Endif
Gosub MoveWord
Else
Ink RGB(255,0,0),0
Center Text 320,240,"You Missed The Word - You Lose A Life!"
Sleep 3000
Dec Lives
If Lives = 0 Then Gosub OutOfLives
Gosub MoveWord
Endif
Repeat
Until MouseClick()=0
Endif
Sync
loop
TimerProc:
Elapsed = (Timer()-T)/1000
If Elapsed = SecsToShow
Ink RGB(255,0,0),0
Center Text 320,240,"You Were Too Slow - You Lose A Life!"
Sleep 3000
Dec Lives
If Lives = 0 Then Gosub OutOfLives
Gosub MoveWord
Endif
Return
MoveWord:
CLS
X = Rnd(Screen Width()-TL-8)+4
Y = Rnd(Screen Height()-40)+20
Ink RGB(255,255,255),0: Box X,Y,X+TL,Y+17
Ink 0,0: Box X+1,Y+1,X+TL-1,Y+16
Ink RGB(255,255,0),0: Text X+4,Y+1,Word$
Elapsed = 0
T = Timer()
Return
OutOfLives:
CLS
Print "No More Lives!"
Print
Print " Your Score Was ";Str$(Points);" Points"
End
Return
If there's anything you don't understand, just ask...
TDK_Man