Thursday, March 9, 2023

Foundation Year Final Project: Production Week 4.

Here are some of the changes I've made to my final project:


Pause Menu.

One of the major changes this week is the introduction of a pause menu, accessible with the Esc key. I wanted to be able to pause and reset the game whenever needed and the pause menu allows for that. 





One issue that I will address soon is that, because of the way the game pauses, the player can turn but not move. Although I have introduced a variable for pausing in the necessary script, I will need to introduce it as a condition for turning. 




EnemySpawner object.

One of the additions that was suggested to me by my teacher was a GameObject in Unity, that you could shoot down and that would spawn enemies. I thought it was a good idea and so I added it into the game. I made it so that the colour of the object reflected the health of the Spawner, and when the Spawner's health dipped to below or at 0, then it would spawn a number of enemies near the location of the spawner device. 


This was fairly easy to program, as it mainly relies on the OnCollisionEnter2D function that I have used many times before in Unity. The trickiest part was the colour mechanism, as I wasn't able to directly change the colour of the sprite by using the health integer. 

Eventually, I decided to just check for the object's health and have the function update according to the number.

void CheckHealthLevel()
{
if (eSpawnerHealth > 75)
{
_spriteRenderer.color = Color.white;
}
else if (eSpawnerHealth > 50)
{
_spriteRenderer.color = Color.black;
}
else if (eSpawnerHealth > 25)
{
_spriteRenderer.color = Color.blue;
}
}






New player sprite. 

Based on user feedback from a game development Discord server, I decided to swap out the sprites that the player previously had. What I went for instead was a series of sprites from the same sprite pack, but with a red baseball cap. I also decided to swap the enemies sprite to what the player previously had. 

This sprite was better received from the server, and I agreed that I enjoyed the sprite more, so this is a permanent change. You can see the sprite changes below. 





You may also notice that there aren't any animations for the enemy yet. This is something I will address within the upcoming week. 


Player speed reduction.

Finally, I decided to place the easiest change this week as the last on this post. After gaining some feedback about player speed on a game development Discord server, I reduced the player's speed from 1.5 to 1 in the inspector.

The result is as shown below:




I decided to stick with the changes by applying it to the player prefab. 

Conclusion.

This week, I added an object for enemy spawning, I changed the player's speed and the player's sprites. 

Next week, I will fix the player's turning when the game is paused, I will also add animations to the enemy and I will work on the game's environment. 




No comments:

Post a Comment

My personal fashion journey... so far.

Intro.  Hello! Today I'm going to be discussing my fashion journey so far! Recently I've been getting into fashion as a personal h...