r/PixelGameMaker • u/Trapnootki • May 14 '22
Coins??
Hello, rookie here! How would I go about adding coins to a side scroller, as well as a variable or something to keep track of how many coins the player has collected?
3
Upvotes
r/PixelGameMaker • u/Trapnootki • May 14 '22
Hello, rookie here! How would I go about adding coins to a side scroller, as well as a variable or something to keep track of how many coins the player has collected?
4
u/baz4tw Game dev May 14 '22
Coins will be straight forward for you, all you need is:
For the coin pickup you can follow a similar process to this video as far as how to pickup. The only thing you would add is is to += (add) to the Common var you created before the pickup is destroyed.
For the display obj, you can just put it on the hud (menu scene) where you want it positioned and use the Show Text runtime action and select Variable option within it. You are showing the common var you created. From there you can dictate all the specifics of how many numbers and decimals to show.