Bonus Features 2 - Share your Work

Exercise

·

Beginner

·

+60XP

·

60 mins

·

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?

Please login to submit

Complete this tutorial

Submission Gallery

Create with Code: Bonus Features 2

Create with Code: Bonus Features 2

All challenges complete. The slider canvas required a lot of fine tuning.

A
atrissanen
0
0
SELF + Tutorial Help

SELF + Tutorial Help

I wasn't 100% confident with this one. I wanted to better understand the use of <> operator used in scripts. But, anyway....I tried to huddle through project ending parts based on help provided here and trying to usderstand myself. Still...very good project to learn from. thank you.

V
vkrajvanshi
12
0
The Cool Game: Animals Runs 2025

The Cool Game: Animals Runs 2025

A study game where all the tasks from lesson: "Bonus Features 2" have been completed. Animals run from top to bottom and left to right. You can shoot steaks at them. Animals have a saturation bar. Music has also been added. A HUD with score and life counters has been added. A "Game over" screen and a "Restart" button have been added.

O
OleChizh
6
0
Game under Development

Game under Development

https://play.unity.com/en/games/0c76a4f3-e7d5-4d70-a42d-b7aa4bfa30ad/create-with-code-veralpha

K
Kasthurirangan
14
0
Prototype2_Unity6

Prototype2_Unity6

Prototype 2 from the Unity Junior Programmer Pathway. A simple arcade game focused on player movement, power-ups, and enemy interactions. This project was created for learning purposes using Unity and C#. Controls: - W / A / S / D or Arrow Keys → Move - Space → Fire Pizza You can play on: https://play.unity.com/en/games/3c1cdda2-36fa-403b-bb84-823e5bc5081c/prototype2unity6

FM
Faez Mahmoudi
50
0
Animal Feeding Simulator

Animal Feeding Simulator

This is the implementation of the prototype 2 project with all the bonus features including some extras like game over screen and using heart sprites as health

M
MahdiNazarian
50
0
Animal Crowded

Animal Crowded

Farmer and animals

A
ahmethocam
50
1
Basic Gameplay Course Game

Basic Gameplay Course Game

The game I made using the Basic Gameplay Course from Junior Programmer Pathway.

G
greceamadalin2003
10
0