Exercises
Description (Game 1 - Vehicle Game):
The player controls a vehicle and must collect all the coins on the track as quickly as possible. The challenge is that the coin positions are not visible in advance, and a pedestrian will be crossing the road.
Details:
-
Before the game starts, the player can choose which vehicle to control: a car or a bus. Display: “CAR (1) or BUS (2)”. If the player presses key 1, they will play with the car; if they press key 2, they will play with the bus. (Models: Course Library/Vehicles)
-
At the start of the game, one coin should appear on the track. When the player collects it, spawn another coin. In total, 5 coins will appear throughout the game. Ensure that no coin spawns in an unreachable position.
-
The goal is to complete the course as fast as possible by collecting all the coins. Display the elapsed time (in seconds) since the start of the game on the UI.
-
A pedestrian will cross the road from left to right. Place a human (Human/Prefabs) on the left side of the track, scaled appropriately. Initially, the pedestrian is idle at the edge of the track. At a certain moment in the game, they will start running across. Implement the animations so that the pedestrian uses an idle animation when standing still, and a running animation when moving.
-
Once the pedestrian reaches the other side of the track, they stop and return to an idle state.
-
If the vehicle hits the pedestrian, the game ends.
Description (Game 2 - Dog in the Enchanted Forest):
The player controls a dog in an enchanted forest. The goal is to escape the forest by opening a chest.
Details:
-
Display the dog’s health on the UI, starting with “HP: 10”. The dog's health decreases by 1 every 2 seconds. Continuously show the current HP on the UI.
-
If HP reaches 0, the game ends. Display this on the screen and prevent further movement.
-
The dog can collect potions to restore health. Each potion increases HP by 5. After collecting one, randomly spawn another potion somewhere in the game area.
-
A lion helps the dog. If the player approaches the lion, it gives advice: “You need to collect a key to open the chest!” This message should appear on the UI.
-
The key is cursed and not visible by default. Pressing the R key makes the key visible for 3 seconds, after which it disappears again.
-
If the dog finds and collects the key, it can open the chest. Replace the Chest closed object with a Chest open object at the same location to visually show the chest has been opened. Display a message on the screen: "You won the game!"