How do I differentiate between multiple touches on the same object?

0 favourites
  • 5 posts
From the Asset Store
Be quick and choose the right answer for the shown equation.
  • I have 3 buttons at the bottom of the screen which are used to shoot bullets. I've used the same object for each button and want to shoot at balls falling from the top of the screen. Sometimes, balls will fall down at the same time so I need to be able to press two or three buttons at once but this isn't letting me shoot bullets with how I'm doing it.

    I've put an image of what I've done so far and I thought having the condition Bullets.X = Button.X would work as they remain the same throughout the entire game but it only lets me shoot one at a time which is no good.

    I've done some reading into Touch.ID but not fully understanding this so I'm unsure if it's the right way to go for my project.

  • Try adding "System For Each Button" as the first condition in that event.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • That seems to allow multiple touch but is no longer running the sub-event, what can I do to fix this?

  • Yeah, it's better to put triggers (as On Touch End) to a separate event.

    // First event
    For Each Button
    Touch is touching Button
    Bullets X=Button.X : Button set frame 1 ...
    
    // Second event
    On Any Touch End
    Touch is touching Button : Button set frame 0 ...
    
    
  • Works perfectly now! Thanks Dop! :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)