Day 12 of my Developer Journey: Triple Shot Powerup code

Triple Shot is now a game object, time to give it its behavior. Since it is very similar to the enemy script, I will reuse most of what we already know to create the behavior required with a few changes. First, once this powerup gets to the bottom of the screen, it will not respawn at the top, this is to simulate that the player only has 1 chance to grab it. Secondly it will move downwards slower than the enemies.

Movement script

Other than that, our powerup will disappear once it touches the player.

Collision script

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