How do I create random spawn positions and randomize platform sizes for a runner type game?

Simple Gamer ArtsSimple Gamer Arts Member, PRO Posts: 305
edited November 2017 in Working with GS (Mac)

So, on my horizontal "canvas" at the very far-right-end I have a spawning-block that touches bottom and ceiling; this spawning-block will shoot platforms towards the left (this is a runner game). So, these platforms will spawn from the top of the Spawn-Block (ceiling) or the bottom (floor), moving towards the left. In an on/off fashion-order, if the platform spawned from the ceiling, then the next will spawn from the floor. As well, these platforms will vary in size, leaving a slight gap in between each spawned platform.

BRIEF SUMMARY:
• I need to know how to spawn platforms from ceiling then bottom then ceiling then bottom ect etc (in that sort of order).
• I need to know how to vary these platforms' sizes, leaving a slight gap in between each spawning.

Thank you!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    For the first part, use an integer attribute to alternate values:

    Timer Every 1 second
         Change attribute game.location to 1-game.location

    [That will alternate between 0 and 1.]

    When attribute game.location=0
         Spawn actor at top of scene

    When attribute game.location=1
         Spawn actor at bottom of scene

  • Simple Gamer ArtsSimple Gamer Arts Member, PRO Posts: 305
    edited November 2017

    That was excellent @tatiang, thank you for that. it worked.

    Ok, now, how can I randomize the Timer instead of every 1 second, I'd like to be every .2 to 2 seconds.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
  • Simple Gamer ArtsSimple Gamer Arts Member, PRO Posts: 305
    edited November 2017

    @tatiang thank you for your help. It was a little beyond my scope honestly, so I worked something else out. Appreciate it!

Sign In or Register to comment.