How to Destroy Multiple Enemies Before Moving On?

  • Is this what you're looking for?

    Destroy to move on!

    Basicly I did the following:

    Sprites created:

    Arena (an invisible sprite covering the entire game screen)

    BadGuy (the enemy you must destroy on collision. It also has multiple frames to change their color with different levels)

    GoodGuy (you! control with arrow keys)

    Global Variables:

    LVL=0 (this variable will tell which level you are in and will greatly help in the creation of the BadGuy in the field)

    Layers:

    Layer 1

    Layer 0

    And a text box to show the value of the variable LVL.

    So basicly what I did here was to place the Arena sprite on Layer 1 and the Good and Bad guys on Layer 0, this way I could create the condition "If Arena is NOT overlapsing BadGuy" since Arena will always stay on top even when new BadGuys come into play.

    When the condition is true, the variable LVL will gain +1 to it's current value, and it will also set a text box with the number that LVL is holding.

    The condition, when true, will also loop a number of times equal to the variable LVL, to create a BadGuy in a random position of the game screen and to change it's animation to a different frame, which holds a different color.

    The reason when changing frames it's LVL-1 is because the frames have a frame numbered 0, so if you're on lvl 1 and the BadGuy has the first frame (which is 0) colored red, then it will be red.

    Hope this helped!

  • Thanks:), but no, I'm looking for something where the greenball must hit/collide with all 2, or 3, or 4 (depending on the level) multiple enemies (but not at the same time) before moving on to the next level:)

  • It seems like it should be easier than that:)...

  • Well either I'm not understanding your problem very well or I'm simply an idiot hehe XD

    Would you kindly explain exctly what you want to do? I always tought it would be something like what my example showed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Haha sorry man:)... OK, here it is, the greenball, or "goodguy" should have to collide with multiple enemies (which are separate sprites) before moving on, it shouldn't be just one sprite reappearing a certain amount of times.

    Thanks...

  • Ah, maybe fiddling around what I did I might figure something, but currently busy at work so it will have to wait, till then hopefully someone comes up with an answer so you don't have to wait long!

  • Hello Guannstar,

    After reading all the posts, it's quite confused. I think you want to do something very simple but at the same time, I'm not sure of what it is. :)

    I think you want to, on each level, get all enemies on the screen destroyed, one after the other, before going to the next level.

    What ArcadEd proposed was a good and simple solution. You just have to replace the "slime" in his sentence by "an enemy".

    Here is a CAPX I hope will help you. It's very simple. Control the green cube with the arrow keys and touch the enemies.

    https://dl.dropboxusercontent.com/u/13847313/Scirra/MultipleEnemiesDeathCheck.capx

  • Wow, yea, that's exactly what I'm trying to do:) Thanks a lot KaMiZoTo:) Really, I can't thank you enough:D

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