How do I make random platforms appers on map

0 favourites
  • 9 posts
From the Asset Store
A template which allows you to customise the controls of your game.
  • Hello,

    i am doing a infinite run game and i have a doubt about how i can deal with 3 pieces(img) of my platform to appear randomly on the game bg.

    Since it will have coins(up the platform) and spikes on the platform..

    Need to do a ~perfect random~ with coins and spikes too.

    Any ideia?

  • I would recommend coming up with a function that does the whole thing, based on certain settings, like position, platform type, coin amount (or pattern), etc.

    That way your content creation is separate from the gameplay bits and way easier to manage.

    Then in the function, depending on parameters you can, for example, have sub-events that do certain things: First one makes the platform itself, second one places spikes in different patterns, third one places coins in different patterns.

    Then you just use whatever game logic to call the function and make your stuff.

  • I would recommend coming up with a function that does the whole thing, based on certain settings, like position, platform type, coin amount (or pattern), etc.

    That way your content creation is separate from the gameplay bits and way easier to manage.

    Then in the function, depending on parameters you can, for example, have sub-events that do certain things: First one makes the platform itself, second one places spikes in different patterns, third one places coins in different patterns.

    Then you just use whatever game logic to call the function and make your stuff.

    Thanks for the reply!

    Do you have some minor exemple to pass?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • :/

  • Vanz

    e.g. like this: https://www.scirra.com/tutorials/999/ra ... node-based

    or like this: https://www.scirra.com/tutorials/383/ra ... -intervals

    def. you need random() to pick it's position or tilenumber, depending on some logic, as Somebody described.

    random-number-between-2-values_t64385

    https://www.scirra.com/tutorials/77/nat ... onstruct-2

    Hope it helps!

  • Vanz

    All right man, after your PM I took a quick attempt. Obviously, there are many many different ways, this is just an example... difficult to know, what you exactly need -- that might be the reason, why not many people started to help you, I guess.

    But there you go bro, have fun, I hope it helps you out!

    Good luck.

  • MultipleChoice

    Thanks for the demo!

    How i can modify this to make the object(present) and the platform appears random on a infiinite BG ?

  • @Vanz: Do infinite scrolling e.g. like this

    Then Spawn the Floortiles limited to the screen height, random in size - similarly, as I did with the presents, then spawn the random objects.

    Of course you need to do it infinitely, ahead of your current players screen. But I would not spawn them, just move them from behind to the front, avoiding too many objects and spawning.

    If you have a rough capx of your idea, I can take a look. Don't just let us do the work...

  • Thanks a lot MultipleChoice

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