1 of 14

DEMO GAME

CS 301

1

2 of 14

INTRODUCTION

  • Requirements:
    • Terrain
      • Hills and valleys
      • Grass
      • Dirt path from beginning to end
    • Playable character
      • Cube – player (parent GameObject)
        • Cube – weapon (child GameObject)
      • Camera follow
      • Keyboard and mouse control
        • Movement, jump
        • Fire projectiles
    • Particle Systems
      • rain

2

    • Audio
      • Ambient – rain, thunder
      • SFX – footsteps, collectable chimes, enemy sound(s)
    • Skybox
      • Night, clouds
    • Collectables
      • placed along path, some hidden in the hills/grass
    • Enemies
      • Cubes
      • Spawn after some amount of time at specific locations
      • Move in random direction or towards player character

Creation of a small 3D game.

3 of 14

PLAYABLE CHARACTER – ADD AUDIO FOOTSTEPS

  • Now, we want to hear footsteps while the playable character is moving.
    • Begin by downloading footstep SFX audio files from the Unity Asset Store and import into your game.

3

4 of 14

PLAYABLE CHARACTER – ADD AUDIO FOOTSTEPS

  • Now, we want to hear footsteps while the playable character is moving.
    • Begin by downloading footstep SFX audio files from the Unity Asset Store and import into your game.
    • Next, select the playable character and add a new Audio Source component.
      • Attach the Footstep audio file to the AudioClip attribute in the Audio Source component.

4

5 of 14

PLAYABLE CHARACTER – ADD AUDIO FOOTSTEPS

  • Now, we want to hear footsteps while the playable character is moving.
    • Begin by downloading footstep SFX audio files from the Unity Asset Store and import into your game.
    • Next, select the playable character and add a new Audio Source component.
      • Attach the Footstep audio file to the AudioClip attribute in the Audio Source component.
    • Open the Pmovement script and add a new AudioSource object
    • Add the following to the Start function:

5

6 of 14

PLAYABLE CHARACTER – ADD AUDIO FOOTSTEPS

  • Now, modify the Update function with the following if conditional statements:

6

7 of 14

PMOVMENT SCRIPT:

7

8 of 14

PLAYABLE CHARACTER – ADD AUDIO FOOTSTEPS

  • Play your game

8

9 of 14

PLACING COLLECTABLES

  • Create a capsule game object and attach a color material.
  • Set is Trigger to true (checked) in the

capsule collider component.

  • Add a RigidBody
    • Set is Kinematic to true (checked)

9

10 of 14

PLACING COLLECTABLES

  • Create a new Monobehaviour C# script named CollectableItem and attach to the collectable capsule GameObject.

10

11 of 14

PLACING COLLECTABLES

  • NOTE: The CompareTag reference to “Player” is the tag set on the player cube.

  • Select your player character and set its tag to “Player”

11

12 of 14

PLACING COLLECTABLES

  • Copy and paste the collectables throughout your terrain.

12

13 of 14

COLLECTING ITEMS (COLLECTABLES)

13

14 of 14

INTRODUCTION

  • Requirements:
    • Terrain
      • Hills and valleys
      • Grass
      • Dirt path from beginning to end
    • Playable character
      • Cube – player (parent GameObject)
        • Cube – weapon (child GameObject)
      • Camera follow
      • Keyboard and mouse control
        • Movement, jump
        • Fire projectiles
    • Particle Systems
      • rain

14

    • Audio
      • Ambient – rain, thunder
      • SFX – footsteps, collectable chimes, enemy sound(s)
    • Skybox
      • Night, clouds
    • Collectables
      • Placed along path, some hidden in the hills/grass
    • Enemies
      • Cubes
      • Spawn after some amount of time at specific locations
      • Move in random direction or towards player character

Creation of a small 3D game.

Complete the Demo Game and submit as the in-class assignment for this week.