Mean Worm Enemy

 

This week I’ve worked on implementing a new enemy type to our game. The original idea was that it would look like a worm, but it ended up looking like a mean snake of some sort with very sharp teeth.

 

It was already planned early on that we would have more types of enemies in order to bring more variation to the gameplay while exploring. And this one, in particular, was to add a bit of a surprise element to our game.

The design was that it would react to a player coming within a certain distance. It would then start digging towards the player, making a rumbling noise in the process. I achieved this by having a variable that would be assigned the moment the player is detected. This variable would contain the current time + a certain delay, which is now assigned as 3.5 seconds.

During these short seconds, the enemy would lock onto the player’s position, but not appear just yet. There’s also another experimental variable that makes it so that when there are 1.5 seconds left until it’s been 3.5 seconds, it would stop locking onto the player’s position. This is because the worm is otherwise nearly impossible to dodge and the player would end up dying a lot.

Once the current time is equal to or greater than the variable we assigned, it will call a Coroutine function that would make the worm move out from the wall and towards the player’s position 1.5 seconds prior. I use Coroutines for this since it’s perfect for the job. It will basically update the function every frame until all of the actions within it has finished. Thus I can have a while loop that checks the distance between the enemy and its target. Within this loop, there’s a MoveTowards() function that will keep moving towards its target until it has reached it. It will then use the very same method to move back into its original position.

 

3fbdc56fa51947aea42a58aeed60642e

The player in comparison to the worm

 

Advertisements

One thought on “Mean Worm Enemy

  1. Good Evening!
    For starters, good job on your game, I am glad that you guys were able to add something to it since the last playtest. It became more interesting that way. Anyway, let’s get down to business.
    I enjoyed reading about what you have done with the enemy and got to understand the logic and thinking behind what you have done. It was pretty enjoyable and you also have a solution in balancing the game, by making the attack commence after a small delay, which makes your work pretty efficient.
    I only noticed that you wrote a couple of sentences twice, so do be careful next time. Other than that, it was an enjoyable read and I thank you for sharing the knowledge you acquired. It was really helpful to me.
    Good luck with the beta and soon the final version. I will be looking forward to seeing your game’s progress.

    Petros

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s