Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim button1 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
If FirstTime Then
timer1.Initialize("timer1", 16)
End If
startTimer = DateTime.Now
timer1.Enabled = True
End Sub
Sub Timer1_Tick
Dim t As Float = (DateTime.Now - startTimer) / 5000 '0 to 1
Dim r As Float = 200dip * t
Dim ang As Float = 5 * 360 * t
Dim x = r * SinD(ang), y = r * CosD(ang) As Float
button1.Left = 45%x + x
button1.Top = 45%y + y
If t >= 1 Then timer1.Enabled = False
End Sub