how to create random, increasingly difficult obstacles?

I have a gravity flip game- The character stays motionless and i'm trying to get obstacles to come towards the character with increasing difficulty (more often, faster), randomly. I haven't been able to find a tutorial and can't figure it out myself, any help is greatly appreciated!

Best Answers

  • tatiangtatiang Posts: 11,949
    Accepted Answer

    Here's the confusing part for me: increasing difficulty, randomly. Is it increasing or it random? Or did you mean that random obstacles come toward the character but that they increase in speed and frequency?

    The idea would be to use something like a custom interval timer (http://forums.gamesalad.com/discussion/comment/464547/#Comment_464547) but without the randomness, and then a separate timer or rule (e.g. every 1000 points) that decreases the self.duration attribute. You would place the spawn behavior inside of the custom timer. So it might start out spawning every 5 seconds, then 4, then 3, then 2, then 1, etc.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • jsorr2jsorr2 Posts: 279
    Accepted Answer

    have 4 different actors (different shapes) and 1 speed attribute and 1 spawn attribute and 1 shape attribute.
    Have a rule every 0.25 seconds, have an rng that picks a number between 0 and 1. If its 1 spawn an actor, if 0, do nothing. Then if spawn is 1 have an rng to pick between 1 and 4. If 1 spawn shape actor 1, 2 spawn shape actor 2, etc. then have an rng pick between 100 and 500, and set the actors velocity to that number.

    Goodluck

    Rng means random number generator

Answers

  • Schroeder Schroeder Member Posts: 6

    I mean random obstacles with increasing difficulty. I'll try this, thanks.

  • Schroeder Schroeder Member Posts: 6

    @jsorr2 said:
    have 4 different actors (different shapes) and 1 speed attribute and 1 spawn attribute and 1 shape attribute.
    Have a rule every 0.25 seconds, have an rng that picks a number between 0 and 1. If its 1 spawn an actor, if 0, do nothing. Then if spawn is 1 have an rng to pick between 1 and 4. If 1 spawn shape actor 1, 2 spawn shape actor 2, etc. then have an rng pick between 100 and 500, and set the actors velocity to that number.

    Goodluck

    Rng means random number generator

    What kind of attributes would these be?

Sign In or Register to comment.