Skip to content ↓

Collecting RANDOM objects

If your game requires the player to collect items or objects, this code may help.

You will need to have created a sprite that can move (See movement tasks)

Next, create a second sprite and add this code:

This example adds 1 point to the SCORE which is a variable.

It could be used to change any variable that you have created -  LIVES, MONEY, ENERGY, TIME

If you want the object to appear in a specific location, you would have to swap the   go to random position   block with a   go to x:  y:      block.