So, you’re adding power ups to your game and you’re using a modular approach to streamline your project. So, in your Power Up script, you’re checking for the power up ID to determine which power up method to activate on the player. …


In a previous article, you learned how to add a power up to your game. Most likely, if you’re adding one power up, you are going to add more (once you power-up, you just can’t stop). …


Animating a sprite in Unity is essentially creating a computerized flipbook. Since a sprite is an image attached to your game object, just swap between different sprites to create an animation.

Switching between sprites in Unity Editor to simulate animation

To create an animation for this Triple Shot Powerup, you would display each of these sprites in rapid succession…


Getting bored with your game? Moving and shooting doesn’t entertain like it used to? Just like a much-needed cup of coffee on Monday morning, fire up your game experience with a Power Up!

Objective: Add a collectible power-up object that changes player functionality

Steps:

  • Build Power Up functionality on the…


Top-down shooter prototype

So far, you’ve been living in a primitive world of colors and shapes, building a prototype of a top-down shooter. Prototyping allows you to focus on programming functionality without complicating the process with assets. The functionality built here, from player movement and instantiating projectiles to spawning an endless stream of…


So, your game is coming along nicely with your enemies spawning continuously…

Spawning enemies over time via coroutine

… but now your Inspector is getting a little busy.


While it’s great that you can use Update() to make something happen every frame, have you ever wanted to just slow things down a little? Unity’s Coroutines allow you to do just that!

What’s a coroutine?

A coroutine is a type of method that allows you to pause processing at a particular line…


Now that you know how two game objects can interact, let’s look at how you can access one script from another. To break it down, you can do this in four steps:

  1. Get a reference to the object
  2. Get and store the script component
  3. Verify the script component exists
  4. Access…

At some point in your game, you’ll need your objects to interact. Whether it’s two cars crashing into each other or a projectile hitting an enemy or anything else you can think of, Unity provides two type of collisions to meet your needs: Surface Collisions and Trigger Collisions.

Surface Collisions

Surface collisions…


As awesome as it may be to fire lasers as fast as you can press the button, you can add difficulty, depth and a dose of reality to your game by implementing a cool-down system.

Objective: Enable time delay between laser fires.

Lasers fire as fast the space key is pressed

Starting Point: Laser fires from Player object as…

Erin Brown

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