0 Favourites

How do I Spawn a Sprite when certain criteria is met?

  • Pretty much in a level in my game i have 2 enemies and i want it so when i kill the 2 enemies and they get "destroyed" i want another sprite to spawn or for future levels i want to switch to a different layout.


  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • have you tried making a sprite make it 10px width and height. Input a variable 'Enemies_count'. and put the number of enemies in it.

    when you destroy enemies -1 from variable 'Enemies_count'. And then run an event like this 'Enemies_count=0' and do what ever action you want to do.

    And if you want something like a specific item to spawn after two and not that third one are killed then just make another variable Item_Timer

    and run the same action of -1 again for on destroyed.

  • Since you want it to carry over layouts, a global variable that you set when object count of the enemies gets to what you want seems like the easiest option.

    Doing it as Gearworkdragon suggests will save you from cluttering the project with too many global variables(all of them being listed whenever you add a system expression and such can be slightly annoying) but you need to make sure that the object is set to global so that it'll carry over.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
Sprite Font Generator - v3
368 112,399
RetroDaddy's avatar
Unread hot topic
86 28,726
St4rDu57's avatar
Unread hot topic
99 10,159
karshinkoff's avatar