How do I create N same objects at the same time

0 favourites
  • 6 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • I need create the same object N times. With a global variable i put the between 2 for 100 for example. But i need create that time.

    With a bucle, but how?

    Thanks for all

  • I need create the same object N times. With a global variable i put the between 2 for 100 for example. But i need create that time.

    With a bucle, but how?

    Thanks for all

    Its hard to understand what you have written but I think you need to use

    SYSTEM > FOR ( 1 to N ) > Create Object

    eg

    + System: For "" from 1 to 200

    -> System: Create object Sprite on layer 0 at (0, 0)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For example, I have one fish in the scene, but I want create N fish at the same time in different positions.

    I don’t know how, but in my mind I think yes

  • Another;

    I use your code, but i have a infinity bucle. Create infity objects.

  • You must use it under a "On Start of Layout" action, or something like this that runs once at a specific time. And use some rule for different positions, like I did below using random values for X and Y.

    TOTAL_FISH=200
    System | On Start of Layout
    ----+ System | Repeat TOTAL_FISH times:
    ---------+ System | Create object "Fish" at layer:0, x:random(LayoutWidth), y:random(LayoutHeight)
    

    Hope this helps...

    Cheers!

  • OMG works!

    Is easy, maybe i dont have a good day ^^

    Thanks so much

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