Spawning objects on a number of fixed places at random

0 favourites
  • 5 posts
From the Asset Store
Spooky Places game assets for 2D endless runner action adventure game.
  • So, yeah in know its now problem to spawn objects in random locations on the layout.

    But i wanna know, is there a simple solution to spawn objects from a random number of differend fixed points?

    If i use the "choose" command, i can only choose between a specific x or x or x AND y or y or y position.

    But i need a choose between xy or xy or xy.

    I hope its clear what i mean.

    (I have some free days and i spend them with friend, drinking, making graphics, drinking, playing around in construct and drinking.......did i mentioned drinking? ^^ Soooo, if there are some spelling mistakes, its the alcohol ^^)

  • Bring some fixed positioned 'spawners' in the layout, all instances of the same Sprite.

    Give those a boolean 'Occupied'.

    + System: Trigger once

    + (no conditions)

    -----> Sprite: Destroy

    ----+ System: Repeat floor(random(0,11)) times <-- this is a random between 0 and 10, fill in what suits you

    --------+ Spawner: [X] Is Occupied

    --------+ System: Pick a random Spawner instance

    ---------> Spawner: Set Occupied to True

    ---------> Spawner: Spawn Sprite on layer 0 (image point 0)

    + (no conditions)

    -----> Spawner: Destroy

  • I´m a bit confused.

    Thats what i have right now:

  • --------+ Spawner: [X] Is Occupied <--- the [X] means inverted (official scirra pseudo code).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am such an idiot. Thx man. ^^

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