The OnObjectTouch
method is updated as follows:
1. First add two FLOAT variables at the start which will store the difference factor regarding objects positions.
Method OnObjectTouch:Int(obj:ftObject, touchId:Int) Local xdiff:Float Local ydiff:Float
2. Check if game mode is equal to the constant
g.gmMenu
.If g.gameMode = g.gmMenu Then
3. Start the
Select
statement on the object'sTag
property.Select obj.GetTag()
4. Check against the constant
g.btnPlay
(the play button). If yes, then start a new game.Case g.btnPlay g.StartNewGame()
5. Check against the constant
g.btnScore
(the score button). If yes, then show the high-score screen.Case g.btnScore g.ShowScore
6. Check against the constant
g.btnExit
(the exit button). If yes, then exit the app.Case g.btnExit g.eng.ExitApp(True)
7. Close the
Select
statement. After that, play theg.sndSelect
sound and close the IF statement.End g.sndSelect.Play() Endif
8. Now comes the part where we check if...