Snowie Snow Game

Tech Stack: Unity 2023, Visual Studio, Maya/Blender, Gitlab

Github

The Assignment

The goal of this game was to make a Christmas themed game in only 2 weeks. I worked together with 2 other developers: Tom Holewijn and Chiel Eikelenboom. I was in charge of the interactive UI and I had to make the power-ups you can see in the video at the top of this page. We had to make the game multiplayer so we chose to make it a split-screen game. The game is also only playable with controller since that was one of the requirements. All said and done I think the game turned out pretty fun and I think the progress we made as developers in the 2 weeks was very impactful for the three of us. We learned a lot more about rapid prototyping and a lot about how to efficiently work with each other.

Code Highlights

Powerup Effect Implementation
public class DecreaseMultiPowerUp : PowerUpScript { public override void DoPowerup() { if (PlayerString == "Player1") { StartCoroutine(UIManager.Instance.PlayPowerupAnim(0, "Enemy x0.5", 0)); StartCoroutine(DecreaseMultiplier(1)); } else if (PlayerString == "Player2") { StartCoroutine(UIManager.Instance.PlayPowerupAnim(0, "Enemy x0.5", 1)); StartCoroutine(DecreaseMultiplier(0)); } } private IEnumerator DecreaseMultiplier(int index) { if (GameManager.Instance.ScoreMultiplier[index] !< 0.5f) { float currentScore = GameManager.Instance.ScoreMultiplier[index]; GameManager.Instance.ScoreMultiplier[index] = 0.5f; yield return new WaitForSeconds(15); GameManager.Instance.ScoreMultiplier[index] = currentScore; } } }

Explanation:
The ‘DoPowerup‘ method represents the functionality of a power-up effect. Key features of this code include:

  • Player-Specific Powerup: Checks the ‘PlayerString‘ to determine which player is affected by the power-up. If it‘s "Player1," it triggers a UI animation and starts a coroutine to decrease the score multiplier for "Enemy" entities. If it‘s "Player2," it does the same for the other player.
  • UI Animation Trigger: Initiates a UI animation through ‘UIManager.Instance.PlayPowerupAnim‘, providing visual feedback to the player.
  • Score Multiplier Decrease Coroutine: Calls the ‘DecreaseMultiplier‘ coroutine, passing the appropriate player index for updating the score multiplier.

  • The DecreaseMultiplier coroutine gradually reduces the score multiplier for the specified player index to 0.5 over a duration of 15 seconds. If the current score multiplier is already less than 0.5, the coroutine is not triggered.



    Powerup Animation Coroutine
    /// <summary> /// plays the powerup animation on screen /// </summary> /// <param name="SpritesIndex"></param> /// <param name="PowerupName"></param> /// <param name="player"></param> /// <returns></returns> public IEnumerator PlayPowerupAnim(int SpritesIndex, string PowerupName, int player) { GameObject anim = null; anim = Instantiate(SpriteAnimations[player], gameObject.transform); anim.GetComponentInChildren<Image>().sprite = PowerupSprites[SpritesIndex];//sprite of the image set to sprite in the list anim.GetComponentInChildren<TextMeshProUGUI>().text = PowerupName;//name set to parameter name yield return new WaitForSeconds(3);//wait till dissapearing anim.SetActive(false); //needs objectpool implementation }

    Explanation:
    The ‘PlayPowerupAnim‘ coroutine handles the instantiation and display of power-up animations on the UI. Key features of this code include:

  • Dynamic Animation Instantiation: Instantiates a power-up animation object (‘anim‘) based on the provided ‘SpritesIndex‘ and ‘PowerupName‘. The instantiated object is a child of the script‘s game object.
  • UI Text and Sprite Setting: Retrieves the ‘Image‘ and ‘TextMeshProUGUI‘ components from the instantiated animation object and sets their sprite and text properties based on the provided parameters (‘SpritesIndex‘ and ‘PowerupName‘).
  • Animation Display Duration: Delays the coroutine for a duration of 3 seconds using ‘yield return new WaitForSeconds(3)‘, giving the player time to observe the power-up animation.
  • Deactivation: Sets the instantiated animation object to inactive after the display duration, effectively removing it from the UI.
  • My Role

  • The Game User Interface
  • Powerup functionality
  • The UI Manager partly
  • Timer functionality
  • Powerup functionality
  • Reflection On The Project

    I really liked this project because me and my teammates got to use our, at the time, newly acquired skill rapid prototyping! We only had 2 weeks for this project so that meant we had to speed up our development and get the idea on paper as quick as possible. AFter the fact I wish I knew more about making algorithms instead of only working on the UI. I loved working with Tom and Chiel and hope I get to work with them in the future again!