How do I spawn some no. of sprite on the start of the layou

  • Hello guys,

    I'm stuck again, i want to spawn around 15 clouds on the start of the game and then i'll spawn them according to players position in the game(unbounded background)

    but for some reason my code only spawns 5 clouds please tell me what i'm missing here...

    Thanks

    postimg.org/image/qec6oakfj

  • Logic looks fine, load it in debug and check if you have 15 instances of cloud.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • your code work perfect.. something wrong happen on other event?

    try only this code a new project and see that work..

  • So try.

  • I just wanted to let you know that you can replace your "for" loop by a "repeat X times" loop. More elegant.

  • in the debug also i only see 5 clouds ,

    CBelle tried the same in a new project but got the same result

    Coin i also used repeat loop but it was spawning those 10 clouds every tic even though there was no everytic event on it (just on the start of the layout)

    martdsam yeah, this work fine, but i wonder why my code didn't work ?

    BTW thanks everyone for your time

  • martdsam in the debug it shows 15 spawn but i can only see 2 present in the scene( and i'm using the free version,could this be the reason for all this?)

  • Well some of the clouds will spawn outside of the layout and initial view because of your settings but you mentioned unbound scrolling..

  • Well some of the clouds will spawn outside of the layout and initial view because of your settings but you mentioned unbound scrolling..

    yeah, that's why i put a dummy object and used it as a player to navigate around the scene but i couldn't find any other clouds

  • Did your dummie walk to negative position values ?

    I suppose not. Dummy stayed in the layout. And layout starts at (0,0). But you spawn at negative value.

  • That's what I initially thought but the reference to unbound scrolling seems to suggest that he's got a player moving up or left from the start on an unbound layout. You're either moving in the wrong direction or there's some other logic conflicting with the create object events.

  • Did your dummie walk to negative position values ?

    I suppose not. Dummy stayed in the layout. And layout starts at (0,0). But you spawn at negative value.

    yes i did check in every direction (using car controller)

  • Look in the debugger. Bring the Dummy as far most left as it can go. What is the Value on the X for the Dummy ?

  • send capx meaby ? ;P

  • martdsam in the debug it shows 15 spawn but i can only see 2 present in the scene( and i'm using the free version,could this be the reason for all this?)

    Sorry for the delay. Try running in debug mode and look for the name of your cloud object in the debug menu list. When you find the object you can view the amount of it in (). I do not think the problem is the free version.

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