Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Type Tagg(C As Byte, R As Byte, colour As Int)
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim lPos As Tagg
Dim col,row As Byte
Dim snd As Label
Dim dirC, dirR As Int
Dim Ticker As Timer
End Sub
Sub Activity_Create(FirstTime As Boolean)
Ticker.Initialize("Ticker",50)
live(10,20,"Bx")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub live(c,r As Byte, sEvent As String)
Dim bx As Label
Dim lTag As Tagg
bx.Initialize(sEvent)
lTag.c=c : lTag.r=r
'lTag.colour=aColours(Rnd(1,6))
lTag.colour=Colors.Red
bx.Tag=lTag
bx.Color=lTag.colour
Activity.AddView( bx,1,1,10%x,10%y)
Log(lTag.c)
Log(lTag.r)
Log(lTag.colour)
End Sub
Sub Bx_Click
snd=Sender : lPos=snd.Tag
col=lPos.C : row=lPos.R
Log(col)
Log(row)
Log(snd.Tag)
dirC=0 : dirR=1
Ticker.Enabled=True
End Sub
Sub Ticker_Tick
lPos.C = lPos.C + 1 'lPos.C + dirC*-1 : lPos.R = lPos.R + dirR*-1
Ticker.Enabled=False
Log(lPos.C)
End Sub