GameDevHQ Crash Course Day#4 It’s raining cubes!

Beginning 2D space Shooter-Enemies

Today I went through making some enemies and having them come down from the top of the screen, along with having my lasers and player interact with them in relevant ways.

I came up with an issue during the enemy collider set up that I could not figure out. I ended up working in a invincibility timer using the time.Time mechanics previous left unused for firing as I couldn’t work out why my player was consistently taking 2 instances of damage every time it collided with the enemy, it would also keep going into -1 health despite the player and enemy supposedly destroying themselves on the initial hits. Then when I was cleaing up code and unity for the next part and I found the issue.

2 box colliders on player

So when I first made the player box, I automatically placed a box collider on it, then following the tutorials I mindless added one when the tutorial did as well, this is what was causing my 2 instances of damage to happen!

Beginning 2D space Shooter-Enemy Spawning

Way too many cubes!

Got back into Coroutines pretty quickly this time, did play around with spawning multiple sets on enemies also added it to the update method for fun, spawning a new coroutine every update frame is definitely not what you want to be doing.

Also added a spawn managing container for the enemies to spawn into so that they do not clutter the hierarchy of unity so can keep that a bit cleaner. Thought about adding one for the projectiles, but will hold off on that for now in case the tutorial wants to group them another way and I have already got a way of removing laser fire when it leaves the screen.

--

--

--

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

RESIDENT EVIL 2 / BIOHAZARD RE:2: Racoon City Revisited.

Esports Predictions 2020

FIFA Mobile Mod Apk 16.0.01 unlimited money/coins 2022

FIFA Mobile Mod Apk 16.0.01 unlimited money/coins 2022

F1® Delta Time Grand Prix™ with another Weather Special is here!

Resident Evil Village: Origins of Horror.

The Dark Pictures Anthology: Little Hope: Being True to Oneself.

Beasties and Bygones Update: New Art & Classes!

PS2: 7 curiosidades

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
Jason Dixon

Jason Dixon

More from Medium

What are Unity Skyboxes?

No Clutter Object Spawning in Unity

Create Enemy Container

The Escape Button Is A Feature!

Unity’s Cinemachine: Look At and Aim Features