How do I make an object vanish: CAPROJ project file INCLUDED

0 favourites
  • 8 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hey guys!

    I'm prototyping the mechanics for my upcoming game.. but now I'm stuck. I'm struggling to explain my problem so I've included a small video + the CAPROJ file. This is my first Construct2 game ever, so I'm feeling a bit like headless chicken. Here is my problem:

    When you touch a screen region (Bottom right) the player moves forward. When you touch the "Bottom left" the player moves backwards. I have a black "touch-sensitive" box that appears when you touch any screen region. The problem is that black box is suppose to vanish when the animation cycle finishes.

    In other words I don't want the black square to remain visible if you keep holding the same place. How do I kill it off, I've tried everything I can think off. Here is a small video of the prototype:

    http://www.totally2d.com/Construct2%20Test.mp4

    My second challenge is that I kind of fell in love with that "swirling circles effect" that happens when you move the cursor in circles. It would make a superb effect in the finished game. Is there a way to make them vanish off faster. Here is the CAPROJ file:

    http://www.totally2d.com/Testing%20Grou ... hanics.zip

    The "swirling effect" would be nice to keep but my main goal is to make sure if you keep touching a single spot, that black "rensponse" box vanishes after a while (1 second will do).

    I don't know if my request makes sense, I hope it does.

    Please help me if you can,

    Tafadzwa

  • You have to distinguish between triggered events (the one with the green arrows) and non triggered. The triggered events will be triggered only once (hence the name), the other will be triggered every tick (60 times a second) the object is touched.

    In your capx, a new squares will be created as long you touch the object and destroyed only after the animation has ended. This means you see a big square because you see the next to last frame of a newly created square. You can see that you are create many squares in debug mode. If you start in debug mode you will see on the left side of the debug window that sprite 7 count up to 32 objects before the the first get destroyed.

    You can fix that with triggered events. I made an example. Hope that will help:

    https://drive.google.com/file/d/0B5FlDY ... sp=sharing

  • ..you see a big square because you see the next to last frame of a newly created square. You can see that you are create many squares in debug mode.

    Thank you very Asmodean you made it perfect!

    I had no idea what was going on, I don't know why I never checked my debug mode. Even if I had, I still wouldn't have solved the issue. I just need to study how you sorted out the events.

    I can't thank you enough,

    I was at the end of my road on that one.

    Tafadzwa

  • You're welcome.

    About the 'swirling circles effec'. Your video doesn't work, so I don't know what you exactly mean.

    Can you explain it a little further?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm now debating weather or not to do that effect now, cause I already love the prototype as it is. I'm a bit torn.

    When someone slides their finger across the screen. Is there a way to spawn a trail of "black squares" that varnishes. Without loosing the progress we've already done. In the final game I can turn those black sprites into sparkles. But now I'm no longer sure if I still want that effect.

    I'm already happy with the solution you've given me. Very happy

    Tafadzwa

  • Something like that?

    https://drive.google.com/open?id=0B5FlD ... WNRak9OZEE

    It's using particles, so be very cautious on mobil with the number of particles. It can be very CPU-Time consuming.

    Play with the properties of particles and see if it's what you are looking for.

  • Thank you Asmodean

    You have really helped me out. I've never used particles, it never occurred to me in this case. I just knew about them, but you've allowed me to see how they cam actually be applied. Now I'm keen to see how the final product would be like if I choose to add particles. I still have a few more ideas I'm going to test out, especially when it comes to attacking enemies.. but I'm now feeling confident about the basic mechanics. Thank you! I'll send you the beta of my game, to check it out once I get it running.

    You've be a great help!!!

    Tafadzwa

  • [quote:32d9kj6l]Thank you! I'll send you the beta of my game, to check it out once I get it running.

    I'm looking forward to it.

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