Objective: Move an object in a zigzag pattern using a mathematical sine Wave.

Why use a Sine Wave?

If you observe the structure of a sine wave it follows the same pattern present in a zigzag movement. This becomes more evident if we flip the Sine Wave on its side as the image below demonstrates.

Regular Sine Wave:

In the previous article, I went over how to detect colliders surrounding the Player, and how to use that logic to destroy enemies within a given area. As a follow-up, this article will cover the visual aspect of the AoE and how it can be set to be a temporary secondary weapon in my 2D Space Shooter.

Objective: Create a shockwave animation that becomes activated through code along with the Area of Effect Attack method we created in the previous article. …

As a gamer, I have always been a fan of Area of Effect(AoE) Attacks — they are amazing for crowd control and they can easily be one of the most useful tools in your arsenal. In the coming articles, I will be breaking down how I added an Area of Effect Attack for my 2D Space Shooter.

Objective: Detect the collider from specific objects surrounding the player within a given area.

Using Physics2D.OverlapCircleAll

Physics2D.OverlapCircleAll returns all colliders within a circular area and allows us to perform an action per collider.

For purpose of the AoE, we’ll be focusing on three of its…

We already have Damage VFXs, Explosions, and a Lives Counter UI…why not make things more dramatic by adding a camera shake when the player gets hit? After all, visually representing gameplay elements makes for great game design!

Objective: Temporarily change the camera transforms to random positions to create the illusion of shaking. Then set the position back to the default so that the camera is not indefinitely displaced.

Making the Camera shake with a Coroutine

  1. Create a new script for the Camera Shake Behavior and name it accordingly. This needs to be a separate script because it will be attached to the camera itself.

2. Create three…

After creating a Lives Counter UI Element, and adding Damage VFXs Using Sprites, it’s time to give the player a way to heal. For the purpose of my 2D Space Shooter, this will be done in the form of a Power-Up, but this logic can work for any collectible that uses a Collision System.

Objective: Create a Power-Up that, when collected, restores lives to their maximum value, or a value of choice. We will also disable the Damage Visual Effects so that the ship looks brand new.

Healing the player

Healing the player or adding life points is very simple to accomplish. In…

In the previous article, I talked about how to program an Ammo Count UI that decreases whenever the player fires their weapon and disables firing when they run out of bullets. With limited ammunition comes the complementary Ammo Collectible to balance out gameplay — we can’t have the player indefinitely run around without bullets right?

Objective: Create an Ammo Collectible to replenish the ammunition for the player.

Preventing the value from overshooting the clip capacity

This tutorial uses the code from the Simple Ammo Count System in Unity and focuses on the programming aspect. …

Displaying the ammo count for our player is not only extremely helpful but adds a whole new level of depth for the gameplay. Limited ammunition makes the player more mindful, and being able to actively see how much they have left can help them prepare better strategies.

Objective: In this article, you will learn how to add an ammo count UI that updates whenever the player fires their weapon. Once the ammo runs out, the player won’t be able to shoot and an “empty ammo” audio will play.

Edit Note: The Ammo Collectible article has been released! If you want…

Who doesn’t love force fields? They make you invulnerable, they look cool and Science Fiction has been hyping them up since 1931! Elements or power-ups that beget temporary invincibility have been present in video games for years — and as a principle of good game design, they are visually or audibly represented for the player.

Objective: In this article, you will learn how to make a forcefield that can absorb three hits before becoming inactive. Each hit will damage the force field which will be represented by changing the color of the shield as it loses power.

Setting up the Sprite Renderer

The Sprite Renderer

ESC button animation by Khalil Hanna

Enabling the option to exit a game or application at any time is a standard feature that should be implemented. The Unity Engine allows us to do just that in a universal way that can work for Windows, Mac, and Linux.

In today’s article, you will learn how to register the Escape button to exit an application or game.

Using Application.Quit with User Input

In the previous article, I went over how to use the Unity Build Settings to create a test version of your game or application which can be fully executed directly from your computer. Now, it’s time to learn how to make it sharable online!

Installing WebGL

Objective: Make a shareable version of your game or application.

  1. Install WebGL if you don’t have it available already. If you already have it installed, skip to Deployment using WebGL.

To install, go to File → Build Settings → Platform → WebGL → Install with Unity Hub

Dennisse Pagán Dávila

An ambitious writer, and video game narrative designer on a journey to become a Unity Game Developer, and Sofware Engineer.

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