The Escape Key is a Feature

We gotta get the heck outta here.

We’ve come a long way in just three weeks, but now we have a fully playable arcade shooter. There’s only one problem: the player is trapped in our game. No, this isn’t an episode of Sword Art Online — though, that would be cool — there’s just no way to quit the application. That’s right, quitting the game is a feature. And while we all know your game is highly addictive and nobody should want to quit, let’s go ahead and make it possible anyhow.

In order to provide our players with an easy means of escape, we’ll need to head into the code. All the user input has been on the Player script so far, but what if the player is dead? That will leave the player staring at the Game Over screen, taunted by the enemies they failed to defeat. Instead we’ll use the Game Manager script.

In the Update method we need to sneak a small block of code to enable the escape key:

Super easy, but easy to overlook.

That’s all there is to this tidbit. The next few articles will focus on adding features to the shooter to flesh it out and give it some play longevity and professional polish.

--

--

--

Unity Developer / Game Developer / Artist / Problem Solver

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

HowTo: Create web-scraper with AWS Lambda

Python makes spreadsheets Excel’lent

Evaluation Method

Mochi.Market x Ecio Giveaway

Getting the most of your Amplitude Data for < $1/month

A/B testing on AWS CloudFront with Lambda@Edge

US Practice Management System — Software w/ Telehealth Reminders and More

US Practice Management System - Software w/ Telehealth Reminders and More

Elixir — Understand Data Immutability

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
Micha Davis

Micha Davis

Unity Developer / Game Developer / Artist / Problem Solver

More from Medium

Unity Animation Event Explained

Pushing Objects in Unity to Complete Puzzles

Using Post Processing Volumes in Unity3D with the URP

Audio Tracks Using Timeline in Unity 2020