Name: Collect Points
Description: The player is able to increase their score by collecting food or stars or other tokens.
Need for Pattern: Having the ability to collect points is a way of increasing player motivation and adding depth to a platformer level. For example when a player is replaying a game they may try to maximise the number of points they collect rather than just having a goal to progress as far as possible in levels.
Related Game Patterns: Add Lives [related], keyAndDoor [related]
Links to other Computing Patterns: , Change Listener, Systems Dynamics
Collecting points so that you get one point every time you collect some food (or similar) involves adding the change score by block to the overlap listener block.
Test your game to check that your changes have the desired behaviour and that there are no side effects. For example, does your point score only increase by one (or your chosen number) as you progress
This Game Pattern is one of many allowing you to make improvements to your platform game and to learn coding and wider computing concepts. Find more on the Game Pattern page.
Some next steps you might want to add player lives or some kind of enemy if you haven’t already.