How do I create random spawn positions and randomize platform sizes for a runner type game?
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
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
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
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.
Try this: http://forums.gamesalad.com/discussion/comment/464547/#Comment_464547
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang thank you for your help. It was a little beyond my scope honestly, so I worked something else out. Appreciate it!