Game Development : Week 08

 

Week 8: Enhancing Gameplay with Conditional Mechanics and Animations

This week in our game development journey, we delved deeper into building our 2D game from where we left off in Week 7. The focus was on implementing engaging mechanics, designing conditional requirements, and enhancing the visual appeal through animations and UI updates. Here’s what we accomplished:


Collecting Coins System

We started by implementing a coin collection system that not only allowed players to pick up coins but also tracked the total coins collected. This involved:

  • Using Colliders: Detecting the collision between the player and coins.
  • Destroying Collected Coins: Ensuring that coins disappeared from the scene upon collection.
  • Displaying Coins Collected: Creating a UI text element on the canvas to dynamically show the number of coins collected.

This added a sense of progress and reward to our game, motivating players to explore the environment.


Adding Conditional Mechanics

Next, we learned how to make gameplay more challenging and rewarding by adding conditions to unlock certain features:

  • Unlocking Doors: We programmed the doors to open only when specific conditions were met, such as collecting a required number of coins or finding a key.
  • Triggering Door Animations: Collisions between the player and the door were used to trigger animations, giving a smooth transition when a door opens.
  • Keys and Additional Requirements: We introduced keys as a secondary collectible, adding another layer of complexity. Players now needed both coins and keys to access certain areas.

Animating the Coin Collection

To make the coin collection visually appealing:

  • We created a coin animation that played when the player collected the coin.
  • The animation was triggered only during the collection event, making it more dynamic and tied to the gameplay.
  • This involved working with the animation controller and setting up triggers.

Displaying Collected Coins Using UI

Finally, we used the Canvas UI to visually represent the player's progress:

  • Text Display: We learned to use the text component in Unity to show the number of coins collected.
  • Dynamic Updates: The UI was updated in real time, providing instant feedback to the player.

Reflections

This week’s lessons emphasized the importance of conditional mechanics and visual feedback in game design. By implementing requirements like collecting coins and keys, we added depth to the gameplay. Animations and UI elements further enhanced the player's experience, making the game more engaging and polished.

Looking forward to Week 9, where we’ll continue refining our game and adding more interactive elements!

Comments