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

Get help using Construct 2

Post » Tue Sep 13, 2016 10:21 am

Message: amitkuliyal can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
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

https://postimg.org/image/qec6oakfj/
B
10
Posts: 26
Reputation: 485

Post » Tue Sep 13, 2016 11:09 am

Logic looks fine, load it in debug and check if you have 15 instances of cloud.
B
47
S
18
G
84
Posts: 2,273
Reputation: 49,800

Post » Tue Sep 13, 2016 11:17 am

your code work perfect.. something wrong happen on other event?

try only this code a new project and see that work..
B
17
S
7
G
7
Posts: 205
Reputation: 5,335

Post » Tue Sep 13, 2016 11:33 am

Image

So try. :D :D
Hi I am Samuel :)

My google play
B
43
S
10
G
1
Posts: 126
Reputation: 3,313

Post » Tue Sep 13, 2016 12:03 pm

I just wanted to let you know that you can replace your "for" loop by a "repeat X times" loop. More elegant.
B
12
S
7
G
7
Posts: 450
Reputation: 4,276

Post » Tue Sep 13, 2016 12:25 pm

@plinkie 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
B
10
Posts: 26
Reputation: 485

Post » Tue Sep 13, 2016 12:46 pm

@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?)
B
10
Posts: 26
Reputation: 485

Post » Tue Sep 13, 2016 12:52 pm

Well some of the clouds will spawn outside of the layout and initial view because of your settings but you mentioned unbound scrolling..
B
47
S
18
G
84
Posts: 2,273
Reputation: 49,800

Post » Tue Sep 13, 2016 1:23 pm

plinkie wrote: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
B
10
Posts: 26
Reputation: 485

Post » Tue Sep 13, 2016 1:31 pm

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.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Next

Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 16 guests