Sub IP_touchdown(screenX As Int, screenY As Int, pointer As Int)
'player touches on screen arrow controls
If (screenX > lArrow.x-vpW*0.16) And (screenX < lArrow.x+vpW*0.20) Then
moveleft=True
moveright=False
movePointer=pointer
Else If (screenX > rArrow.x) And (screenX < rArrow.x+vpW*0.36) Then
moveright=True
moveleft=False
movePointer=pointer
End If
'player touches fire button
If (screenX < fireButton.x+vpW*0.30) And (screenX > fireButton.x) Then
firing = True
firePointer = pointer
End If
end sub
Sub IP_TouchDragged(ScreenX As Int, ScreenY As Int, Pointer As Int)
If Pointer = movePointer Then
If (ScreenX > rArrow.x) And (ScreenX < rArrow.x+vpW*0.2) Then
moveleft=False
moveright=True
Else If (ScreenX > lArrow.x) And (ScreenX < lArrow.x+vpW*0.20) Then
moveleft=True
moveright=False
Else
ship.mx = 0
End If
End If
End If
End If
End Sub
Sub IP_touchup(screenX As Int, screenY As Int, pointer As Int)
'stop moving if move pointer lifted
If pointer = movePointer Then
ship.mx = 0
movePointer = 0
moveleft=False
moveright=False
If controlscheme = 2 Then firing = False
End If
'stop firing if firepointer lifted
If pointer = firePointer Then
firing = False
firePointer = 0
End If
end sub