Phase II — Progress Report — Enemy Movement Updates

Luke Duckett
2 min readMay 5, 2021

In this quick update, I am going to show the changes I have made to the enemy movement.

The player is now encouraged to destroy the enemy before they reach the bottom of the screen as the enemy gains the ability to move left and right if they get respawned, making it a lot harder to hit them.

I added in a new coroutine that picks a direction for the enemy to move and assigns a random time to travel this direction for. This function then loops.

The function does not get called until the enemy is respawned. I use a bool to check if the enemy has respawned so we only call the coroutine once.

Finally, we just make sure we now clamp the enemy to the bounds of the screen.

All we have left is to test our new functionality.

That’s all for now.

--

--

Luke Duckett

🎮 First Nations Unity Dev from Wonnarua country 🏞️ | From Player to Lifelong Learner: Crafting Games, Debugging Code, and Embracing New Technology