How do side scroller games spawn their gold coins?
WhySoCREATIVE
Member Posts: 75
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..
For games like MegaJump, Jetpack Joyride etc.... (Unlimited distance) but still with random spawns of boosts, coins and obstacles..
Best Answers
-
TheGabfather Posts: 633The 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. -
tatiang Posts: 11,949Try 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_383521New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers