Bonus Features 2 - Share your Work

Tutorial

·

Beginner

·

+60XP

·

60 mins

·

(9)

Unity Technologies

Bonus Features 2 - Share your Work

In this tutorial, you can go way above and beyond what you learned in this Unit and share what you’ve made with your fellow creators.

There are four bonus features presented in this tutorial marked as Easy, Medium, Hard, and Expert. You can attempt any number of these, put your own spin on them, and then share your work!

This tutorial is entirely optional, but highly recommended for anyone wishing to take their skills to a new level.

Languages available:

1. Overview

This tutorial is entirely optional. If you are not interested in this extra challenge, simply scroll to the bottom of the page above the Submission Gallery and select "Skip submission and continue". You can still successfully complete the course without attempting any of these bonus features.


This tutorial outlines four potential bonus features for the Feed the Animals Prototype at varying levels of difficulty:


  • Easy: Vertical player movement

  • Medium: Aggressive animals

  • Hard: Game user interface

  • Expert: Animal hunger bar

Here’s what the prototype could look like if you complete all four features:




The Easy and Medium features can probably be completed entirely with skills from this course, but the Hard and Expert features will require some additional research.


Since this is optional, you can attempt none of them, all of them, or any combination in between.
You can come up with your own original bonus features as well!


Then, at the end of this tutorial, there is an opportunity to share your work.


We highly recommend that you attempt these using relentless Googling and troubleshooting, but if you do get completely stuck, there are hints and step-by-step solutions available below.


Good luck!


2. Easy: Vertical player movement

Allow the player to move forward and backwards within a certain range.


This makes the game a bit more dynamic and allows for the addition of other features.



3. Medium: Aggressive animals

Have animals that also spawn from the left and right side of the screen. If one of them hits you, “Game Over” should be logged to the console.


This will make the game much more exciting and requires the player to stay on their toes, especially if vertical movement is also implemented.



4. Hard: Game user interface

At the start of the game, display in the console that the player’s Lives = 3 and Score = 0. If the player feeds an animal, increase and display the Score. If the player misses an animal or is hit by one, decrease and display the Lives. When the number of Lives reaches 0, log “Game Over” in the console.



5. Expert: Animal hunger bar

Display a “hunger bar” on top of each of the animals. Then, each time you feed one of them, the hunger bar fills up a little. Each animal should require different amounts of food to successfully “feed” them. They should only disappear after their hunger bars are full.



6. Hints and solution walkthrough

Hints:


  • Easy: Vertical player movement

  • Look at how we are doing the left and right movement range.

  • Medium: Aggressive animals

  • Look at how we are currently spawning animals and doing collisions.

  • Hard: Game user interface

  • You will need to update the score and lives in the DetectCollisions script, and update the lives in the DestroyOutOfBounds script.

  • Expert: Animal hunger bar

  • You will need to add a UI Slider object in World space Render Mode as a prefab for each animal, then set the slider’s value through a script every time the animal is fed.

Solution walkthrough


If you are really stuck, download the step-by-step solution walkthrough.


Note that there are likely many ways to implement these features - this is only one suggestion.


Optional Step

7. Share your work

Have you implemented any of these bonus features? Have you added any new, unique features? Have you applied these new features to another project?


We would love to see what you've created!


Please take a screenshot of your project or do a screen-recording walking us through it, then post it here to share what you’ve made.


We highly recommend that you comment on at least one other creator's submission. What do you like about the project? What would be a cool new feature they might consider adding?


Complete this tutorial