Top-down shooter

Link to top-down: https://meg-h.itch.io/tank-shooter

I found this one easy to follow along with the process.

Scripting

The player:

Using the mouse and applying this to the turret so It follows the mouse.

Using a Bullet prefab to shoot out of the turret, I used different shapes for each part of the player and used parents to group them all together one on top of the other.

Applying this to the base I could move all around the map, the min and max were where the player could stay inside the camera.

Enemies:

Spawning enemies using:

Using a timer to keep enemies spawning and using coroutines, enemies will continuously spawn until told not to.

Spawning in different areas around the map, not in view of the camera, giving where they can spawn in.

Spawning enemies at a different rate and when they can spawn more and when they can spawn less using if and else if statements.

Classes of Enemies

The enemies will follow the player using this script

It does this when I have attached the Player tag to the sprite so it knows which it is supposed to follow, and then each enemy using prefabs will have a different speed for difficulty.

If the enemy collides with the player’s bullet then it will be destroyed and when the player dies it will no longer spawn any more enemies. It will also add to the score every time an enemy dies.

This is the scorekeeper which is added to the text at the top and every time you kill an enemy it will add a certain amount to the score depending on the class of the enemy.

Different speeds and scores for each prefab.

Feedback

I received a bit of feedback from a few people when it was still early

  • It was very fun and had a good pacing.
  • Thought it could have had walls for cover.

How I could develop the game further

I would have added walls in but I struggled a bit to execute it and was under some time constraints.

What I learned

  • How to make the mouse invisible and make an object track it
  • How to make different types of enemies.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *