How do I recreate (spawn) clouds?

Just started using Construct 2? Post your questions here

Post » Sun Jan 22, 2017 4:18 pm

Hi! I probably can't see the forest due to all the trees (german saying). In my platform game I want clouds to appear and move constantly to the right. I already positioned 8 clouds (copies of the first one) and after they've moved let's say 500 pixels a new cloud is meant to appear where the first one started. So I guess it has something to do with spawning, instances variables, creating objects, comparing X and the like. But I just don't know what to do. Unfortunately the beginner's guide didn't help...
Thank you already!

Screenshot of clouds:
https://www.dropbox.com/s/x6a9cpcjg5agv ... s.png?dl=0
B
12
S
3
G
1
Posts: 46
Reputation: 1,518

Post » Mon Jan 23, 2017 2:47 pm

The easiest way would be to make a sprite object and clone it as many times as you need cloud spawners. Now place one of these "cloud spawner" cubes at each cloud spawn location. Then either use Every X seconds or Every X seconds with Random(0-#) as seconds to spawn clouds.
On your cloud object itself use the bullet behavior to make it move right and a fade behavior and set the fade to begin when spawned via action and set the fade timer to be whatever lifespan you want for the clouds with a destroy action after the fade action.

If your game doesn't scroll to right you could also put a rectangle sprite just off screen that is the height of the screen and use an On-overlapping this "cloud killer" condition on cloud to destroy clouds after they leave screen.

Also if your game does scroll right you could put the scroll-to behavior on all your "cloud spawners" and adjust the offset so that they stay off screen behind the player/camera but follow along behind spawning their clouds.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
68
S
17
G
8
Posts: 637
Reputation: 9,420

Post » Tue Jan 24, 2017 5:04 pm

Thank you!! But you need to copy it instead of cloning. I used this destroy sprite at the end of the layout and worked with sine behavior instead of bullet. Your ideas helped me a lot! In case you want to check the latest version: https://www.scirra.com/arcade/adventure ... 14457?cp=3
B
12
S
3
G
1
Posts: 46
Reputation: 1,518

Post » Wed Jan 25, 2017 2:11 am

Excellent work, clouds seem to be spawning nicely too. :)
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
68
S
17
G
8
Posts: 637
Reputation: 9,420


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests