The Law of Attraction

Let’s give our player the ability to pull power-ups towards themselves. The player can do this if they have the C key held down and there is time remaining in the tractor beam bar.

The player script will find every object in the scene tagged as a power-up. For each one of those objects, the codes tells that object to move towards the player. The tractor beam timer will also decrease.

If there is no time left in the timer or if the player releases the C key, the timer increases at a fraction of its decrease rate (currently set to half speed, but the developers can play with this value as they wish).

A savvy player will notice they keep the C key held down and be able to attract power-ups at what is effectively half speed indefinitely. And I’m fine with that! SHIP IT!




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store