Help with spawning a random enemy

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi, i am training construct, and its quite awesome, but i have a problem, i wanted to create a button that when we clicked, it starts a timer and at each second it has a change of spawning an enemy, i know it has something to do with time delta, and some random variable, that if the random variable equal to 1 for example, it turns the enemy visible or spawn an object, but im trying but i cant make it works, can someone help me plz?

    Thank you

  • Try a group.

    On object clicked

    ->system set group "spawn" enabled

    -group "spawn"

    every xxxxx miliseconds

    -> system create object enemy at random() x,y

  • newts would work

    also just as easy would be a global variable ('spawningon')

    if ('spawningon') = 1

    system create enemy

    also if you want the enemy to be random, put all the enemies in a family

    let's say you put them in a family called enemies

    if you create object "enemies"

    it will choose something from the family at random to create

  • Just one question, where i create a group?

    Thank you again for the help

  • right click where you would create events

    create group instead

    honestly if the enemy spawning thing is the only thing the group will do, I see no reason to use a group instead of a pv, groups are more suited to large sequences of events, not just one simple action

    just use a global or private variable, I would suggest

    but do go ahead and test out groups anyway so you can see what they are

  • Im sorry but cant do it, cant find the IF statement, only find Else OR While, im new to this and im sorry but u both talk as if i know about construct sorry but thank you anyways.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try the ghost shooter tutorial linked on the main scirra site

    To learn the basics

  • The IF statement in construct is actually called a "Compare" your looking for System -> Compare Global Variable

  • I already did the ghost tutorial about 1 week ago and did other 2 tutorials, but finally i could do it thank you all for the help.

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