How do I make platforms spawn randomly with specific ammount

Get help using Construct 2

Post » Thu Jul 20, 2017 9:20 am

Hello, I am trying to create a tower jumping game and I am making platforms spawn randomly in the game. The problem is that I don't want to have too any platforms spawned at once, as such this will make the game very easy. Is there anyway I can control the number of platforms spawned randomly at a specific amount? Thanks.
B
4
S
1
Posts: 2
Reputation: 304

Post » Thu Jul 20, 2017 11:32 am

You can use random function for spawning, like every random(1,10) seconds, spawn platform.

This will spawn platform every 1-10 seconds interval. You can of course increase or decrease this depending on your game.


You can also limit them with an id, lets say you have 50 platforms, set 10 to id 1, 10 to id 2 etc, this should be an instance variable, then you will need another global variable to toggle which group to spawn in the every x second add another condition platform id == global id, then at each every x call add 1 to the global variable. And when variable gets to 5-6 where they are no platform with that id reset it back to 0. This will add you extra control.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Thu Jul 20, 2017 1:39 pm

Thanks, I can now achieve what I wanted with my game.
B
4
S
1
Posts: 2
Reputation: 304


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 30 guests