Random platform generation

00george

  • Posts: 161
Hi im trying to make a game like doodle jump and have been trying to make a random platform generation behaviour but for some reason when ever it spawns the platforms they spawn at the top of the screen. My behaviour is below. Any help would be appreciated.

coleislazy

  • *
  • Posts: 2607
The Y attribute is only getting set once, at the very start of the scene, because it is directly inside the "when created" wrapper. Move it into your timed block, below the create actor block.

00george

  • Posts: 161
its better but they still spawn at the top of the screen and now that start generating downwards.

coleislazy

  • *
  • Posts: 2607
If you want the initial Y to be lower on the screen, set it to a higher number before you begin spawning the first platform. To do this, use the block under the Attributes category called "set Y to _" and put in the desired number. Note that 0 is the top of the screen and the numbers get larger as you move toward the bottom.