Example
Example
Click on the example then use the arrow keys/WASD to collect the coins.
Fully understand the concept by watching the tutorial in full screen at high res.
Once you have watched the video, you can refer to the code below to help you make your own that fits your game. Make sure you type it yourself to help you learn.
You might like to make a file called 'coins' or whatever your collectibles are called with code similar to this.
You can call the checkCollisions() function in update() in main.
The 'distance' and 'randRange' functions are not built into microStudio, you will have to go here and click import source file .