I'm trying to create a two player game, and I want both players to be able to control their player objects separately and at the same time. But I'm having trouble coming up with a way to do this.
At first I though that using Touch.XAT(index) might be the solution. But I don't know how I should reference the index part for each object.
From what I understand the Touch.XAT(index) command requires an index number, which relates to the order of each touch e.g. 0, 1, 2, 3.... etc. How can I find out the order each object was touched, so that I can use that information to select the correct index value for Touch.XAT().
I've attached a capx of what I have so far. I currently have both set to index 0, which is okay if you touch the objects 1 at a time, but if you try to touch both together, they both go to the same .X position. I've tried to set the index property on plyr2 to (1), but this only works if plyr2 touches the screen after plyr1, and as I can't tell which player will touch the screen first this won't work.
Can someone let me know if I'm on the right lines, or have I completely misunderstood what Touch.XAT(), is for?
Thanks for your help.