Space Shooter Unity
This is a demo for a game i developed by following along the tutorial from Unity Tutorial website here. The name of the game is space shooter. The artwork and the tutorial is property of Unity. I followed along with the tutorial videos to make this demo and this demo is the final output of my unity project. You can download assets for the project here as stated on tutorial website.
The game is a simple 2d game created by using unity. This game works in desktop or web using keyboard but in this tutorial i followed along another live session(Link for tutorial) where the game was converted to work with mobile. I converted the project to work with iOS which created a Xcode Project to deploy the application to real device(iPad in my case) but making this project to work on Android or Window Phone is only matter of selecting the build target in build settings otherwise everything else in the game works for mobile.
You as a player control a fighter plane and you are in space. There are waves of asteroids that you have to face. You can move anywhere on the screen using your controls(keyboard for web version, swipes for mobile version) and shoot lasers to destroy the incoming asteroids. You get 10 points/asteroid destroyed and the game ends when you get hit by an asteroid. The asteroid comes in waves of 10 when the first 10 asteroid come in wave 1 and you survive then after few seconds the second wave starts. The game has explosion animations, audio, and for moving player tilt effects.
You can view screenshots and video for both iOS and web versions below.
How to Play The game
You can play the demo either by going to the bottom of the page and playing the unity live demo or by going to the url(https://jawadrashid.com/Unity/Space-Shooter/). I could only post the web version of the demo not the iOS version as iOS version requires a developer account and is run from a Xcode project which is 500MB+ in size.
In the web version you can control the player by using arrows keys(up, down, left and right for movement) and space key for shooting shots.
For the iOS version the left side of the screen acts as a virtual joystick(not visible). You can start movement by holding down a finger on the screen anywhere on the bottom left of the screen, then move in the direction you want the player to move. Shooting in mobile version is by clicking the right screen of the game.
NOTE: In order to play the game make sure that you are using Safari, Firefox.
If you choose chrome then you might need to enable NAPI follow instructions here. Chrome no longer supports unity web player since they have disabled npapi plugins in latest version. Use Safari/Firefox instead. Also, you will need to download unity web player https://unity3d.com/webplayer in order to see the unity demo below. Make sure that you allow the unity plugin in your browser. Just use the directional keys left, up, down and right to play the game. When the ball touches the pick up yellow items your score on the top left of the screen adds up. When you pick up all the items you will see you win message.
What i Learned from the Tutorial
I learned a lot from this tutorial. What i learned from this tutorial are given below:
- How to set up a new unity project.
- How to import textures and models in a project.
- Setting up multiple cameras and lighting to give the game the look and feel needed.
- Adding background.
- How to move the player by using C# Scripts.
- Tilting the player.
- Creating/Shooting shots.
- Adding boundary and doing trigger detection for hazards with environment and player.
- Adding explosions animations for player and hazards.
- Spawning waves of hazards.
- Adding audio for background, player shooting and explosions.
- Scoring and ending the game.
- Building the game for iOS and Web Versions.
These screenshots are from both iOS and web versions.
Unity Live Demo
If the demo below does not work go then go to https://jawadrashid.com/Unity/Space-Shooter/ to play the demo. Put your browser in full screen mode. Arrow keys move the player and space shoots.