Unity: Shooty McShooterson

Shooty McShooterson (Unity)

For this project I have to create a game using the tutorial provided and my own creative freedom, with that, the game will be a 2D shoot em up game, similar to arcade titles such as asteroids and Galaga, with similarly easy to understand gameplay loops.
As stated before creative freedom has been left to me, so I will be making the game in a pixel art style and be implementing different gameplay elements.

The Process

The entire development process starts with the game engine in use; this being unity. After opening the program I:

After this I changed the resolution to a HD 1920 x 1080 and changed the background colour to a simple creme background. As this is easier to differentiate the player from the background.

 

The Character

I figured instead of the airplane shooter of the tutorial I would create my own little world. Starting with my own simple character and theme, this being a sheriff and a desert as this is easy to understand and not too different to the plane of the original.

Starting with the ever-growing story of shooty mcshooterson.

McShooterson will be facing an onslaught of waves of desert creatures, so they are well equipped with the tools to be stamping out all the enemies.

McShooterson is imported into unity and the necessary folders have been added to the directory.

Troubleshooting

A problem I encountered came in trying to turn this 30 x 30 pixel character HD. I thought scaling it up unity would fix this but this wasn't the case. So I went back to my software and figured out how to upscale my image, This started with:

Another problem arose when the computer was trying to change the pixels to make it smoother, as would be standard in photography. however this wasn't helpful when creating a pixelated character and basically turned McShooterson into a pile of mush and To fix this issue I had to change the up-scaling from bi-cubic to nearest neighbor:

Collisions

The problem stated in the tutorial was that the player could feel cheated out of a loss through the collision system. via enemy attacks just barely hitting you or in some cases hitting the outskirts of your characters collision.

To combat this, in certain game design factors such as coyote time in platformers, or sturdiness in first person shooters, the player will get leeway on the collisions to feel like they just barely evaded the enemy attacks, this is turn requires less precision and makes the experience of the game feel tough but fair.

Feedback

I gave a small questionnaire to some friends of mine to give some feedback on McShootersons character: finding that the hat seemed to be a bit too jagged, and that it may hinder some people from seeing the character as a cowboy.

 

Final Sprite:

Making McShooterson Move:

Basic movement was as simple as following the tutorial. however I messed around with the values to create a system I felt was fast enough but not chaotic enough to hinder player freedom.

I labelled this using the commentary, so that I understand what the code is doing

some easy troubleshooting was checking variable names, caps and semi colons

Animating

I made my own walk cycle for mcshooterson. its a simple idle animation that makes mcshooterson be able to move linearly. I then implemented this animation into unity using the tutorial:

this is my hierachy

I made a walk cycle, i made the extra node to emphasise that the character is running away from something, almost limping away.

This is the animation, I made his head dip up and down to make it look like he is running; I did this by shortening the pixels per unit. frames 3 and 5 are shortened to 80 PPU rather than frames 1, 2 and 4s 100 PPU. This effect gives players a sense of urgency and helps with the constant movement of the game.

The Story.

By this time, through creating McShooterson and advancing with the project, I came up with a simple story and motive for the games existence. McShooterson is actually a lone survivor of a zombie apocalypse, and his only goal is to survive from one safe space to the next, to hopefully find more survivors (hint: everyone is dead... sorry)

With this simple story, it sets a motive for our character, as well as a challenge to overcome. this will give the player reward when they succeed, while also given a new challenge. and the cycle repeats.

This cycle is common with things like arcade classics. Made to give quick hits of dopamine, but always leaving the player wanted to go further.

This is the idea that the game will ride on.

Clamping the movement.

This highlighted code creates a barrier for the player so they don't infinitely go into the abyss.

Within unity you can edit the functionality of your objects.; Giving them gravity, allowing the sprites to be frozen in a certain direction and the hitboxes can be edited and changed.

 

Examples of different bullet types in the game (Prototype)

 

Examples of different enemy types in the game (Prototype)

Feedback and Colour Theory

 

pretty unanimous votes; this worked for me as that was my intention with the colour scheme. I chose the colours specifically based on mine and my friends experience with video games. Red is usually harder and purple can be connoted to special.

I changed the sprite to make the outlines darker. not only to tell the player where the enemy is, but to follow with the general scheme of McShooterson.

Enemy health:

This wasn't part of the tutorial but I thought it would be interesting to give all enemies health and make my bullets do different damages.

To do this I first had to create multiple classes to span across my existing bullet script, and my new enemy script. using public classes allowed me to edit it in Unity, and use those classes in both scripts!

The damage int class was added, this allowed me to use this code for both different bullet types.

This code tells the bullet when its hit the variable named "Enemy" to take away a set bullet damage away from its total health.

The Health System:

This next C# script was an optional health system I added to the game, this adds difficulty to the game as not every enemy should be killed in one bullet.

Using the bullet script from earlier, in conjunction with this script, I was able to make the health system:

 

These 3 highlighted classes all do the various actions I want.
The top gives the enemy health.
The bottom tells the enemy to take damage, when hit with a bullet
and the middle allows for the enemy to die.

The "TakeDamage" class has a section of code underneath, to the enemy to take damage as stated previous

the variable "Die" does exactly as stated:
plays a death animation on the position of death.
then gets rid of the object.

http://www.indieretronews.com/2021/07/galaga-arcade-classic-as-early-c64.html

 

The animation created for enemy death, my idea was to create something cartoonish like the big shot show from cowboy bebop:

Progress So Far:

Things Done!:

Background:

I had to make a looping background for the game, so I created a document that was 3840 x 1080. doubling the width of 1080p. that way the final image would be two screens long.
I started by creating a gradient:

This gradient would change the scene from a desert to a zombie landscape, like the character was going through dangerous territory.

The terrain is littered with cacti and tombstones, to add to the danger McShooterson is in, finishing the loop, I made it to look like McShooterson HAS to keep moving, otherwise players might question the quest McShooterson is on.

DEATH!

One of the final things I did was create the player death. This was programmed into the game via the same way as the enemy death:

If I had more time in the project, I would've made a custom death animation for McShooterson

Sound Design:

This is another instance where I tapered off the tutorial; i found a way to create my own sound effects using a website called jsfxr. It is a free to use software and let me cleanly edit sound effects.

Implementing these sounds into the game was as easy as attaching the sounds onto an action or spawn. Such as a bullet spawn would spawn with a sound attached, And the action of player and enemy death has different sounds.

For the music I used another free to use and share website called

Final Game Video!

 

  • Final Evaluation

This project went a lot better than I thought it would and I've learnt a lot about coding and creating games. Creating the game from scratch using an art and games software was a hard but freeing to do. I did well on finding and patching problems, my shortcomings came in time management and overall design. Given more time and with the hindsight I've gathered through doing this project I believe I could've made a better game. However this sets a good starting point for my future games and experiences in the course even outside of game making.