Games Development:Week 04

  Week 4 Tutorial: Building My 3D Game with Background Music and Effects

This week’s tutorial was all about bringing a simple 3D game to life with engaging sound and movement. For Task 04, our goal was to create a 3D game where the player character jumps through a constantly moving background while sound effects and background music enhance the experience.

To start, I learned the process of adding background music and sound effects to match player actions, which adds a much more immersive feel to the game. I found it fascinating how much depth even a basic sound effect can add when the player jumps or interacts with the environment.

After adding sound, the next step was making the background move, which proved key to giving the game a sense of progress and movement. I also explored how to make the player character jump smoothly, adjusting the box collider and tweaking its settings to fit the character’s movement better. This involved fine-tuning jump duration, gravity, and the force applied, which really allowed me to see how much control you can have over a character’s feel and response in gameplay.

Overall, this week’s tutorial taught me how fundamental these elements are in creating a polished experience, even in simpler games. I’m excited to carry this knowledge into Challenge 3, where I'll be applying and expanding these skills further!


Challenge 3 - Balloons, Bombs, & Booleans

In Challenge 3, I dove deeper into the mechanics of arcade-style gameplay by introducing elements that really bring our balloon-themed game to life. The objective was to make the gameplay more dynamic and interactive by implementing floating balloons, scrolling backgrounds, and spawning obstacles like bombs and collectible objects. Here’s a breakdown of what I accomplished and learned during this week.

Challenge Objectives

The goal of this challenge was to:

  1. Make the player’s balloon float when pressing the spacebar.
  2. Create a seamless scrolling background to enhance the immersive feel of a floating world.
  3. Spawn bombs or collectible objects (like money) that either help or hinder the player’s progress.
  4. Display fireworks as a fun effect when collecting money.
  5. Prevent the balloon from floating too high or dropping too low.

Key Features and Code Highlights

1. Floating the Balloon with Spacebar

  • I used the Input.GetKey(KeyCode.Space) check to make the balloon float up as long as the player holds down the spacebar. This mechanic gave players direct control over the balloon, adding a fun and engaging challenge.
  • I made sure this function only works if gameOver is false, so players can’t float endlessly after the game has ended.

2. Seamless Scrolling Background

  • To create an endless background effect, I used a repeating background script (RepeatBackgroundX) that resets the background position once it reaches a certain boundary.
  • This small but important detail enhanced the gameplay by providing a sense of continuous movement through the sky.

3. Bombs and Money Spawn Mechanics

  • Using the SpawnManagerX script, I set up obstacles (bombs) and collectibles (money) to spawn at randomized intervals.
  • I implemented the InvokeRepeating function to call the SpawnObjects() method, spawning these items periodically to keep the gameplay interesting.

4. Adding Effects and Sounds

  • When the player collects money, the fireworksParticle effect and moneySound are triggered, creating a satisfying reward for the player.
  • On the other hand, if the balloon collides with a bomb, the explosionParticle effect is triggered, followed by the explodeSound, which ends the game.

5. Game Boundaries

  • To prevent the player’s balloon from floating too high or sinking too low, I added boundary conditions in the player movement script. This ensures that the balloon bounces back or stops moving if it reaches the set limits, maintaining control over gameplay.


Comments