How do side scroller games spawn their gold coins?

I see many games randomly spawn gold coins in a wavy order or very neatly. But still have to randomly spawn obstacles.
For games like MegaJump, Jetpack Joyride etc.... (Unlimited distance) but still with random spawns of boosts, coins and obstacles..

Best Answers

  • TheGabfatherTheGabfather Posts: 633
    Accepted Answer
    The ones from Jetpack Joyride for example, are scripted. That's how you get coins spelling out "BARRY" or come in the shape of a ♡.

    You can do the same by spawning multiple coins at once with different but predetermined X and Y coordinates. You randomise through a set of Rules that contain those spawn scripts.

    In Jetpack Joyride whenever you get a new vehicle the very first set of coins that appear will always correspond to the type of vehicle that Barry is riding -- in which case, they not only randomise through their spawn scripts, but they are also keeping track of the situation the player is in.

    So before randomising through your spawn script Rules, you can also have a Rule or order of Rules that check your player's situation e.g. The player has just set a new High Score! Let's reward him with 3 sets of coins that make up ☆'s!

    You can pull off a lot of neat stuff with randomising intelligently :) just make sure not to have coins on top of or behind platforms and deadly game objects.
  • tatiangtatiang Posts: 11,949
    Accepted Answer
    Try my demo. It doesn't scroll at all, but it's one way to spawn a pattern.

    http://forums.gamesalad.com/discussion/comment/383521/#Comment_383521

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

Answers

  • SingleSparqSingleSparq Member Posts: 1,339
    edited February 2014
    You could have an off screen actor that moves back and forth (or up/down depending on orientation) that spawns the coins, even program it to stop in position once and a while to leave a single trail of coins.
  • WhySoCREATIVEWhySoCREATIVE Member Posts: 75
    Thanks guys! I guess the table scripted is the best way to do it and I would need a smart table that can do randomised coin output. I have to time it well so that it does not spawn with obstacles as well...
Sign In or Register to comment.