Phase 2 — Pickup Collect

Nicholas Lim
Jun 18, 2021

--

The player will have the occasional ability to quickly collect all powerups and collectibles on screen by pressing C.

Player script

The Player script has a similar cooldown effect to prevent spamming of this ability. It will notify the UI Manager to activate/deactivate a new Text element that indicates when the pickup ability is available.

When CollectPickups is called, it creates an array of Collider2D objects around the player in a 10f radius (basically all of the level). From this array, the ones tagged with “Powerup” or “Collectible” will have their ActivatePickupCollect methods called.

Powerup (and similar one on Collectible) script

Once ActivatePickupCollect is called on the powerups and collectibles, the _pickupCollectActive bool is toggled to true, and these objects will quickly move towards the player.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response