LoseBiene
Multi touch get pretty tricky, and there is no way to know how many fingers a player may try to put on the screen, so it is best to track all touches and decide what each one is allowed to do.
I like to create a sprite called TouchPoint that has all the instance variables I need to track the touch - where it started, where it is now, where it just was, how long it has been in touch, etc...
I made two global variables: PlayerTouchPoint and GunTouchPoint to lock control of the player and firing the gun to one TouchPoint instance. That way, if the player isn't watching where their finger is, the same touch will keep doing what the player wants it to do.
so, this will work with any number of touches starting and stopping, but only one at a time can control player movement, and firing the gun.
https://www.rieperts.com/games/forum/touchinput.capx
NOTE: I always have a HUD layer and put the TouchPoints on that layer so that any scrolling of the layout doesn't interfere with tracking how much the player's finger has moved.