Skip to main content Link Search Menu Expand Document (external link)

Part 12: Challenges

Table of contents
  1. Resources You Could Use (All from OpenGameArt.org)
  2. Challenges
    1. Add Background Music (Easy)
    2. Add Sound Effects (Easy)
    3. Add Text Information Bout Each Item (Medium)
    4. Add a “Magic Shop” Using Particle Effects (Medium)
    5. Monster Selector (Medium)
    6. Character Randomizer (Hard)

Throughout this project, you have explored the basics of the Unity Canvas system. This is less than 1% of everything Unity has to offer. Unfortunately, a single project or guide will never be able to teach you everything that the engine has to offer. However, there are thousands of fantastic resources available for you to learn from. It is now your turn to explore a topic of your choosing to expand upon this project. Below are several challenges that you can choose from. Or, if you’re feeling ambitious, come up with one of your own!

Resources You Could Use (All from OpenGameArt.org)

  • Pixel Art Food Builder Icons: LINK
  • Adventure Game Equipment Sprites: LINK
  • Fantasy Icons: LINK
  • Parallax Background: LINK
  • Underground Background: LINK
  • Space Background: LINK

Challenges

Add Background Music (Easy)

Research how to add an Audio Source to your scene to play a music file. When the Weapon Shop or Armor Shop are open, add an Event Listener that changes the music.

You an use any music you’d like but here are a few that I have written that you can use: LINK

Add Sound Effects (Easy)

Find several sound effects that can be played when a weapon or Armor item is selected. For example, each weapon could have a different sound:

  • The stick makes a “thud” sound
  • The sword makes a “schwing” sounds
  • The Chain armor makes a “chunk” sound

Right click and add an “Audio > Audio Source” to your Scene. This will allow you to play audio. Play with the options and see what you can learn!

This RPG Sound Pack is an excellent option to get started: LINK

Add Text Information Bout Each Item (Medium)

Add text elements to your scene to display the name, description, and price of each item.

  • Create a new Canvas for your text elements (they shouldn’t disappear when you switch shops)
  • Add 3 text elements to the new canvas
  • Position them in a “pleasing” way on the screen.
  • Add the appropriate Event Listeners to each buttons OnClick event.

Demo of a project with this feature: LINK

Add a “Magic Shop” Using Particle Effects (Medium)

Research how to use the Particle Effect system built into Unity to make a “Magic Shop”.

  • Add a Magic Game Object to your Player Game Object
  • Inside of the Magic Game Object, add an Effects > Particle System
  • Rename the Particle System something like “Blue Magic”
  • Play with the Particle System features in the Inspector
  • Make several (at least 3) different “Magic” options
  • Create a Magic Shop canvas with buttons which call the SetActive option appropriately for each of your “Magic” effects.

Demo of a project with this feature: LINK

Monster Selector (Medium)

The sprites you’re using for this project come from a game that has additional assets. Make a second project using those assets. A “Monster Selector” would be great! But, you can suggest another project of your own design.

Enemies: LINK

The idea here is to use the enemy images to create a project similar to this one which shows the enemy image and displays a little information about them.

Character Randomizer (Hard)

Research how to use the Random class to generate random numbers. Then, using the randomly generated number, call a specific buttons OnClick method.

  • Create a public List WeaponButtons; in your PlayerController
  • Write a method public void SetRandomWeapon()
  • Use the Random class to generate a number between 0 and WeaponButtons.Count.
  • Select the button from the list using generated number (e.g. WeaponButtons[0])
  • Call the button’s onClick.Invoke() method (e.g. WeaponButtons.[0].onClick.Invoke())
  • Create a new button in your Weapon Shop called Random Weapon
  • Update the Random Weapon button to call SetRandomWeapon()
  • Repeat the above s
  • Bonus: Add a Random Character button that calls both methods.

Join the Discussion

Before commenting, you will need to authorize giscus. Alternatively, you can add a comment directly on the GitHub Discussion Board.