If Object is in collision with other and you tap the screen do something.

0 favourites
  • 3 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hello! I'm new at Construct 3, still trying to produce my first game, I have small knowledge of programming and also I'm quite new at Construct 3. So far so good!

    Let me show what I'm trying to achieve.

    As you can see on the attached image:

    - One Candy object with 5 frames (each frame different candy color)

    - One Emiter that spawn candy frames every certain amount of time.

    The candy has a path find code to get to the Destination Object following path

    All black are solid objects.

    The checkpoints objects is where I'm stuck!

    What I want to do is, once a spawn candy produced by the emiter is following the path and collides with a Checkpoint, if the candy has a certain frame (defined from 0 to 5 to detemine a specific color) and you click tap or touch event when they collided. If frame = 2 for example (let's set 2 as actual value) then that candy is destroyed, only that one.

    Can someone explain me how I could do this?

    Thanks!

  • "On collision" is a triggered event, it lasts only 1 tick (1/60 of a second). It's impossible to tap at the exact same moment. So you need to use "Is overlapping" condition, which lasts while objects are overlapping. Try this:

    On any touch start
    	Candy compare animation frame=2
    	Candy is overlapping Checkpoint 
    		: Candy destroy
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks a lot for your help :D!

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