Last line of the-fence

charmseer
3 min readJun 19, 2021

--

Figuring out how to get started with a new software is an uphill battle. But fortunately when it comes to Unity and Game design, we have Brackeys.

So I went through the How to make a Video Game playlist. It takes us through the basics of developing a 3D game in Unity, stage by stage. So I started building. The explanations were simple and the prototype worked fine. It had implemented player movements, game mechanics, basic UI, a score system based on the distance travelled. Of course you don’t understand everything the first time around. You keep building it again and again until the ‘why’s became clear. Whenever deeper understanding was needed you could read the comments or go through the answers on Unity Forums/ Stack Overflow. The Unity Documentation is your friend.

Equipped with all of that I moved into the next build — Dodge The Blocks Live Stream. This was a simple 2D Game in which the player had to evade blocks falling down at the player from above. The speed of the blocks was a function of time and the player could move left and right within the play area. Somewhere in between the video he suggests that we could try to improve the concept. So I gave it a go.

Use the link below to Play the Game! :)

https://play.unity.com/mg/other/lastlineofthefence

A Story of a Sheep evading a farm was made up. The player has to guide the sheep through the farm’s the-fences. Unity’s new input system is made use of for Player Movement. Player can be moved left or right using A/S button or the Arrow Keys. On Screen Touch buttons have also been added for Mobiles/ Tablets.

Game Mechanics

Player has to guide the sheep without colliding with the fences. Game ends when Player collides with the Fence. Collision is handled using scripts attached to the Player Object.

A modified Score system was implemented which increases the score based on the waves of blocks successfully crossed.

A High Score system was implemented using Player Prefs.

UI

A Main Menu Scene with Options to Play the Game, Controls, Credits and Exit Game was added. The presence of the Exit button is sort of like an anomaly, games these days don’t have one. The only way to exit the application in most games is the Exit Panel that pops up when you press the Back button (◀) which is part of system UI on Android Devices.

So, an Exit Panel was designed and coded to pop-up when the Android UI Back button was pressed. It would also work when you press the Esc Key o Keyboard, since Unity treats both actions the same way.

In Game Pause button was added to allow Player to Pause the Game. A panel would pop-up giving the Player options to Resume the game, Return Home or Exit the Game.

Sound Effects (SFX)

A Bass Sound theme was added which would play during the runtime of the game. The sound used is Bass beats Music from https://www.zapsplat.com

On colliding with the Fence a Crash sound is played along with the Game Over Message. The sound used is Tree Breaking Crash sound from :
https://freesound.org/people/373676/sounds/368467/ licensed under CC0 1.0

Visual Effects (VFX) and 2D Assets

A Player Sprite Sheet was created using GIMP and then animated using Unity’s Animator Controller.

A Particle system the generates Stars gets displayed when the Sheep collides with Fences.

The fences were also drawn in GIMP and then assigned to Game Objects.

The Meadow background is a Pixel Art Grass image from Wikimedia Commons linked below. https://commons.wikimedia.org/wiki/File:Pixel_art_grass_image.png

Play Tests

First 3 builds of the Game were made for PC/ Web and instructions were provided in the bio of the game. So users easily understood that the sheep could be moved using A/D keys.

The 4th Iteration of the game was exported to Android. On Playtesting it was seen that most people just clicked on the Play Button without even checking the Controls Menu. Since there was no Onscreen Buttons they had trouble figuring out how to move the sheep. As a result on screen images for the buttons were added. The images for the Buttons are from Onscreen Controls by Kenney Vleugels (www.kenney.nl) licensed CC0.

The existing description in the Controls Menu was also expanded to provide a clearer picture of how the game worked.

Takeaways

--

--

charmseer

Dreams things up and brings them into reality with code. Unity | Blender | SparkAR | LensStudio