Touch one or Touch two Question
Elfizm
Member Posts: 489
Hello
So quick question that I need help with. If I have a two player on screen game where it involves players to always touch their bat ect. Can I just say if touched do action, or do I have to say if touch one or touch two. There is going to be two touch points on the screen. So only if player one is being touched will it move to touch position. But there is also player two actor that only moves when touch and follows touch position. How would I do this.
Bit confused in how i am going to know who is touch one ect.
Thanks
Elfizm
So quick question that I need help with. If I have a two player on screen game where it involves players to always touch their bat ect. Can I just say if touched do action, or do I have to say if touch one or touch two. There is going to be two touch points on the screen. So only if player one is being touched will it move to touch position. But there is also player two actor that only moves when touch and follows touch position. How would I do this.
Bit confused in how i am going to know who is touch one ect.
Thanks
Elfizm
Comments
In regards to previous question, if two touches are at the same time. And one touch becomes released. Will the other one be recongised as touch one or will it stay at touch two.
Elfizm
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Thanks heaps, so how would each actor know which touch position to follow if it can keep Changing touch count?. A two player pong type game for example?
Elfizm
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
So just to confirm things, the two actors, player one and player two. If they are pressed and the touch is moved they will move to that touch position. But what if both actors are touched at same time with two different fingers, will it know only to follow the touch position of the one that touched it or will it go straight to the other actors touch position.
Does that makes sense? And thanks again for answering but I feel I don't understand it.
Elfizm
Rule: when touch is pressed and attribute touch.count = 1
Change attribute: player1.touchorder to 1
(Rule inside this rule) when (any) attribute touch.count = 1 or attribute.player2.touchorder = 2
Link any movements and such to touch1 inside this rule.
(We add the other player to this because if that actor was assigned touch 2 and remains pressed it will hold touch2 even though the system touch count drops to 1. So that leaves touch1 unused so we need to be sure when you touch the other actor it gets assigned touch1 even though the system will now read two touches.)
(Otherwise) change attribute: player1.touchorder to 0
Duplicate rule
Rule: when touch is pressed and attribute touch.count = 2 and attribute.player2touchorder (doesn't 2
Change attribute: player1.touchorder
Link any movements and such to touch 2
(Otherwise) change attribute: player1.touchorder to 0
Do the same for actor 2 only use the player2.touchorder attribute you created.
This is tough logic to explain but I hope this helps.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
I have a virtual DPad on the left, and a large "ShootBox" actor that fills the middle of the screen. I've been using TouchCount to assign an ID to each, but it falls apart if the player starts to hold down and release the various touch pads in certain ways.
The player can press either one, either one at a time, or at the same time. The DPad controls the player movement. Tapping the Shootbox has the player shoot at that position.
It all works fine, except when...
* The player holds down the DPad (this becomes Touch1) and moves the character around.
* The player holds down the Shootbox to shoot their weapons (this becomes Touch 2).
* The player releases the DPad (while still holding down the Shootbox), then presses the DPad again. Now it still senses 2 touches, and so assigns Touch 2 to the DPad. Now the player starts to shoot towards the DPad (instead of towards the finger touching the Shootbox area), which is not my desired behaviour.
It would be great if Game Salad itself could keep track of which touches are currently available, so that the actors can assign the lowest available touch count to a new touch, and then track it.
I'm finding it hard to figure out a way to do this myself in my game. But I guess I can come up with a way... somehow.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
I attempted to get multi touch working but because it does take skill I could only make a fake multi touch game, in other words if would work but it was done in such a poor way you could tell. So I put that idea on side for now until i have the time to work on it full time with no other projects.
But I do wish you the best of luck finding a solution
Especially if you have different touch areas around the screen, that need to be aware which touch they are, and also track the movement of the finger (taking X,Y input in real time). As well as some areas that don't have any touch sensitive content, but need to collaborate with touch sensitive areas to know how many touches are active.
Anyway, I've kind of got something fairly good working for myself. Shall have to see how I go!