Published in Geek Culture·May 27, 2021Creating Enemy ExplosionsTake them out in style — What is better than exterminating your enemy? to watch them explode upon elimination. Special Effects give a game that special eye-candy that many desire. Here, we are going to make our enemies explode in a ball of fire when they get destroyed. To attach the sprite animation of the explosion…Gaming6 min read
Apr 30, 2021Giving Your Game a Main MenuAnd yourself some credit. — All games should have a Main Menu with a splash scene. In our game all we need is a cool graphic and a New Game button. The splash screen / Main Menu should be a scene on its own. …Unity5 min read
Apr 29, 2021Loading Scenes in UnityTrigger with a key press — Your player is having an awesome time playing your 2D Space Shooter game. Eventually they loose all their lives. They would like to play again, so let’s give them this option. …Unity5 min read
Apr 28, 2021Creating a Retro Game Over BehaviorLets Make it Flicker Too. — Now that we have run out of lives, it is time we tell the player the Game is Over. In order to add this text to our User Interface, we will need to add a text object. Select Canvas, right click and select UI, Text.Unity4 min read
Apr 24, 2021Displaying Player LivesMore UI Elements — Previously we added the player’s score on the screen. Now lets add how many lives the player has at any given moment. We will be using some sprites for this. In Sprites, UI, Lives, we have 4 life options, no_lives, One, Two and Three. In order to get the sprites…Unity4 min read
Apr 23, 2021Ease of Building UI Elements in UnityAdding UI elements to your game — Getting UI elements on to your game like Score or Lives available or text boxes, etc. is quite simple in Unity. We have our player, enemies, lasers and powerups ready. Now we need to work on our interface. For our game to be more interesting, we need to have a…Unity6 min read
Apr 21, 2021Using Arrays To Spawn PowerupsSpawning The Powerups Randomly — Speedboost is only our second powerup, TripleShot was the first. In our SpawnManager script, we can see that we have hard coded the spawning of the TripleShot. We could do this for each powerup because we only have three, but imagine if you had 30 or 40 powerups in your…Unity3 min read
Apr 20, 2021Switch Statements to the RescueFor a better readability — When we need to compare the value of a variable we can use the if statement. If there are several possibilities depending on the value of the variable then we would use if else if statement. …Unity2 min read
Apr 19, 2021Creating Modular Powerup SystemThe more the better — A game without powerups is a very boring game. Then again if you only have one powerup it isn’t that great. So we make several powerups for our game, for example, in our case we will have a TripleShot, a SpeedBoost and a Shield. We already have the TripleShot powerup…Unity3 min read
Apr 17, 2021Spawning The PowerupDetermining How Long Powerup Effects Should Last — We have created our sprite animation. Now we need to make it appear in our game. To do this, lets go to our SpawnManager script. Notice we already have a spawning coroutine for our enamy gameObjects. So we have to make something similar for our powerup.Unity2 min read