Has screen touch changed in v1.3

colin9876

Active Member
Licensed User
I downloaded v1.3 trial today as its been a while since I did any programing and my 1.0 had expired.

I couldnt seem to get any code to work, so I tried running some of my previous programs (like lunar lander, and missile command) and all of those dont seem to respond to screen presses anymore.

Has something changed that I have to code it differently now?
 

colin9876

Active Member
Licensed User
ok thanks Erel, something funny is going on. Old versions of my programs work but newly compiled ones dont. Nor do they respond to touch on the Emulator either.
Could someone try this and see if it recognises screen taps?
Oh and can someone remind me of the character I had to type first to insert the code properly in a forum post? Ta

Sub Process_Globals
End Sub

Sub Globals
Dim h,gap, thrust As Float
Dim canvas1 As Canvas
End Sub

Sub Activity_Create(FirstTime As Boolean)

canvas1.Initialize(Activity)
canvas1.drawline(0,97%y,100%x,97%y,Colors.DarkGray,3%y)
h=8%y
thrust=0
gap=2%y


For n=0 To 10000
h=h+thrust
thrust=thrust+(gap/120)

canvas1.DrawLine(45%x,h,55%x,h,Colors.Yellow,4%Y)

If h>97%Y Then crash

DoEvents
Activity.Invalidate

canvas1.DrawLine(45%x,h,55%x,h,Colors.Black,4%Y)
Next

End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
End Sub

Sub Activity_Touch (Action As Int, X As Float, Y As Float)
thrust=thrust-gap
End Sub

Sub crash
If thrust <gap Then canvas1.DrawText("Landed",200dip,200dip,Typeface.DEFAULT_BOLD,30,Colors.Blue,"LEFT")
If thrust >=gap Then canvas1.DrawText("CRASH",200dip,200dip,Typeface.DEFAULT_BOLD,30,Colors.Blue,"LEFT")
h=8%y
thrust=0
End Sub
 
Upvote 0

colin9876

Active Member
Licensed User
Ahhh I see, well I also found DoEvents wasnt ideal so maybe its time I went to Timers

The only reason I avoided timers is because my emulator is soooo slow that I didnt want to mess about with the Designer.

Is there a line of code I can use to add a Timer, or does it require booting up the Designer?
Thanks
 
Upvote 0
Top