problems with multitouch implementation. please help.
chandan1014
Member Posts: 14
Alright, so while making an ipad game which basically involves two users to input at the same time, i ran into a problem. My gameplay screen is divided into two equal halves and each user touches a point where his actor follows. So i created two large invisible actors which define the equal halves of the gameplay and are supposed to store the co-ordinates of the point of touch for each player. Now suppose player1 (and only player1) touches his part of the device, and the touch gets registered as touch1, and i get to know the co-ordinates of the touch point. The problem is, in a situation when both the players touch the device at the same time, i don't know if touch2 was done by player1 or player2, since i don't know if player1 touched the device first or player2. I have trouble deciding where to get the position values from, i.e. from touch1 or touch2.
So what i need to know is the number of the touch (touch1 or touch2) that is touching my actor so that i can set it to get position co-ordinates form that touch. Is there any way that i can get the touchX (where X is the no. of touch which touches the actor) value?
Any help would be deeply appreciated. Waiting for an answer. Fingers crossed!
So what i need to know is the number of the touch (touch1 or touch2) that is touching my actor so that i can set it to get position co-ordinates form that touch. Is there any way that i can get the touchX (where X is the no. of touch which touches the actor) value?
Any help would be deeply appreciated. Waiting for an answer. Fingers crossed!
Comments
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
i have written my rule like this, in case the actor is touched, it will store the value of touch1 or touchX. i need to know if the touch that touched the actor was touch1 or touch2 so that i can store the value of that specific touch.
waiting for reply...
The iPad can handle 11 Touches, so I'm not sure if every actor needs to account for all 11? I haven't played with it yet.
edit: i figured it out. please pardon me for the silly question
edit #2: the downloaded file is a .game file which gamesalad seems incapable of opening. am i doing something wrong?
edit #3: pardon my me being silly. figured it out
edit #4: @firemaplegames: thanks for the help
HOWEVER, this will download a file ending with a .game extension. which is not openable by GameSalad.
You need to rename the extension from .game to .zip
Then, Double-click on the .zip file and you will get the appropriate .gameproj file.
Alternatively, when you are browsing the demos and tutorial, you will notice that the file has a few tags associated with it. You can use these tags to search for the file in GameSalad Creator, under the Shared Projects tab. That way you don't even have to download the project, it will open up directly in GameSalad.