Spawn different object types.

0 favourites
  • 7 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • I need to spawn different types of objects in a certain order for each level.

    What type of system can I use to control this and how can I decide what type of object to spawn?

    Thanks

  • you could use triggers (when the character walks over this marker) spawn object to another marker.

    instead of making a marker spawn the object - you can use the 'system action' "create object" then set the x and y.

    These are the two methods I use, if you experiment a lot with positioning then having the enemies spawn to markers can make it a lot easier to muck around with it.

  • This is similar to the solution I am currently working on. The part I'm having difficulty with is deciding which object to spawn.

    Would using an array to store which objects and what order to spawn them in be the best solution here?

  • You could use arrays, for me it complicates things though.

    You could make a marker spawn a random monster if you wanted, but if say you wanted a line of four guys, then I would use four markers for simplicity. Or If i really only wanted one marker I would use image points to put them in the order I wanted.

    So the event would look like;

    Player on collision with (trigger) --> Marker1 : Spawn x monster

                                               --> Marker2 : Spawn y monster

    Hope this helps.

  • Nope this isn't really what I am looking for. Maybe you've misunderstood me.

    Think angrybirds, the way you have different types of birds in a set order for each level. Once one has been used up the next one spawns. I need something similar to that system.

    Cheers.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • quick idea

    What about setting text variable ie:

    Global variable: spawn_order = "blue,red,grey,white"

    and then using TokenAt you could separate and specify which one will spawn first, second, third...

  • quick idea

    What about setting text variable ie:

    Global variable: spawn_order = "blue,red,grey,white"

    and then using TokenAt you could separate and specify which one will spawn first, second, third...

    What a great idea for an alternative to Arrays.. complicate things why don't you?.

    //* CAUTION CODE AHEAD */

    if I

    store spawn_order = "blue,red,grey,white"

    inPlay = | spawn_order(TokenAt(random(0,4))|

    foreach spaw_order | == inPLay|

    call function | loadInplay(inPLay)

    function loadInPlay(inPlay)

    if inPLay == red|

    use |system createObject( red)

    this is just a rough idea, no screenshots as yet just thinking off the top of my head

    /* END OF CODE */

    would this get a random colour?

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