Object spawning during multitouch

Get help using Construct 2

Post » Sun Mar 30, 2014 4:31 pm

Hello,

I'm working on a touchscreen game for multiple players. The idea is that a player can tap the screen anywhere once to create a canon, then drag the canon around to control it. If another player wants to join, they can tap anywhere as well to create another canon (as long as they're not within a certain radius of any other canons to avoid accidental spawns by one person).

I've got the basics of this implemented, however, I've noticed that I can't seem to be able to spawn any new canons while any existing canons are being touched. So, if one player is dragging a canon around, the other player's touch will do nothing until the first player lets go of their canon. Also, if two players touch the screen at nearly the same time, only one will spawn a canon. It's worth noting that, once spawned, all canons can be moved at the same time, so it's definitely picking up all the touches (just not when spawning objects is involved.)

Can someone explain what I could possibly be doing wrong here? I've done all sorts of tinkering with the code and nothing seems to remedy this problem. My capx is attached.
You do not have the required permissions to view the files attached to this post.
B
5
S
2
Posts: 37
Reputation: 699

Post » Mon Mar 31, 2014 2:53 am

Update: Okay, figured out the problem, but the solution still escapes me.

I don't want canons to spawn too close to each other, so I create a "noSpawnZone" around them at the same time the initial touch creates a new canon. However, by adding the condition "Touch is NOT touching a noSpawnZone" to the "On any touch start event", it restricts any new canons from being made while an existing canon is being touched (because there's a "noSpawnZone" being touched SOMEWHERE).

So, is there a way to "pick" the touch being referenced on the "Any touch start", so it would only check if the touch that triggered the event is touching a "noSpawnZone" rather than checking if ANY touch is?
B
5
S
2
Posts: 37
Reputation: 699


Return to How do I....?

Who is online

Users browsing this forum: asdtricky, pmerineau, Yarfapet and 14 guests