Objective: Create a countdown timer to utilize whenever you need it
While working on adding another weapon to the space shooter I ran into an issue where I am trying two separate effects, but could not implement them correctly without a timer.
From the Unity forums
Using waitforseconds allows that 1-second pause before counting down. It’s a simple yet, really great way to implement. I slightly modified the code to read like this:
When the loop ends in IEnumerator, the particle effect I implemented disappears and my child item is disabled. Further, it won’t keep counting past 0.
Objective: Understand how to implement an ammo system
What to implement:
I modified the existing prefabs created for speed and powerup. …
Objective: Understand how to give the effect of the enemy firing back and taking damage
Understanding what you need to implement it:
Objective: Utilize the explosion gameobject when the enemy is destroyed
Drag the explosion gameobject into the prefab folder. Delete it from the Hierarchy view.
Create a gameobject for the explosion and serializefield the gameobject.
[SerializeField]private GameObject _explosion;
Save it, attach the explosion prefab to the enemy prefab. Instantiate the explosion in the Enemy script in the OnTriggerEnter2D method under the “playerweapon” if statement.
Instantiate(_explosion, transform.position, Quaternion.identity);
For basic functionality of an explosion, this is really it.
Objective — Understand how to create, manipulate sprite size, and animate an explosion in Unity.
When creating an explosion, it gives a game that cool or wow effect. The explosions used in this are provided by Will’s Pixel Explosions! on itch.io
Objective: Understand how to create a game object that gives the player an advantage in-game.
The idea of the powerup is seen in the majority of games. Whether its a boost with a mushroom in mario kart or extra stats for a weapon in an RPG. …
Objective: Create the ability to destroy enemies and lose lives
Objective: Ability for the laser to destroy the enemy, the player, and lose lives. As an extra ability, the laser object will be destroyed when colliding with an enemy.
Objective: Create an enemy to spawn on-screen
Here we have a player object using a playerweapon object to fire the weapon. The enemy object randomly generates within the borders of our game screen.
I started by dragging a sprite into the Hierarchy section
Objective: Understand how to implement null checking and a simple game over screen
While playing with UI features in Unity, I wanted to try creating a basic game over Text object to display on the screen. Then remove the score Text from the screen.
Started with a new Text object…