How do I make platforms spawn randomly with specific ammount

  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks, I can now achieve what I wanted with my game.

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