[SOLVED]problem counting objects

This forum is currently in read-only mode.
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • hi everyone, well I'm been working in a game like arkanoid, every works well except for one thing. when the ball destroy all the block go to the next layout, ok. first I created a global variable(blocks) and a condition:

    Star of Layout

    ----------------->+ System: For each Sprite5

    + System: Trigger once

    -> System: Add 1 to global variable 'bloques'

    and works, but here is the problem, when the ball collides with two or more blocks at the same time just count 1 in the global variable. so the next condition is not satisfied:

    + System: Is global variable 'bloques' Equal to 0

    -> Wait: Delay 500 ms

    -> System: Go to layout 2 with transition "None" lasting 0 MS

    how to solve this little problem or what condition I can use for when the ball destroy all the block go to the next layout. thanks in advance.

    here you are the .cap http://www.box.net/shared/8s69oi3yyh

  • Where do you destroy the block? You might want to add 1 to the Bloques variable in the same event that you destroy the block object.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you can just have a

    System - Compare - Sprite5.count is equal to 0

    ----------go to Layout 2

    just so you also, you don't need a trigger once in a start of layout,

    also, in other situations when you need to have that "two or more blocks at the same time" add the right amount to your global variable, there is a system condition CountMatching("Sprite5") that would tell you exactly how many things were overlapping.

  • wow thank you so much the solution of lucid works perfectly

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