0% found this document useful (0 votes)
9 views

Programming C# Fundamentals Final Exam (1)

The document outlines the final exam for Programming & C# Fundamentals, detailing the requirements for a Unity project. It consists of four parts focusing on player functionality, button interactions, enemy behavior, and player health management. Students must ensure their code works correctly and adhere to guidelines against using AI-generated code.

Uploaded by

laibasahiba1208
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Programming C# Fundamentals Final Exam (1)

The document outlines the final exam for Programming & C# Fundamentals, detailing the requirements for a Unity project. It consists of four parts focusing on player functionality, button interactions, enemy behavior, and player health management. Students must ensure their code works correctly and adhere to guidelines against using AI-generated code.

Uploaded by

laibasahiba1208
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Programming & C# Fundamentals Final Exam​

FALL SEMESTER 2024


INSTRUCTOR: SELMANE GHAOUI

Before You Start

Make sure you have the correct version of the Unity Editor which is version 2022.3.38f1.​
Then download the project template available on the exam web page in ÜZEM and extract
its content into a folder of your choice. Then open the project using Unity Hub.

This project should look something similar to this screenshot:

Do not forget to install the New Input System package from the Package Manager.​
All objects in this scene also exist as prefabs accessible in the “Prefabs” folder that exists
among your assets.

To submit your project, go to your project folder and select the “Assets”, “Packages”, and
“ProjectSettings” folders and compress them into a ZIP file. Submit that file when done.

1
Part 1:

In this part you will make the player object functional and be able to do the following:

●​ Move on the X and Z axis using either WASD or the arrow buttons.
●​ Be able to jump using the spacebar but ONLY when the object is grounded.
●​ Shoot bullets (“PlayerBullet” prefab) forward using the left click button. The player
can only shoot one bullet every one second (cooldown of 1 second). The bullets
should self-destruct after 4 seconds or after coming in contact with any object
except for the player object itself.

Part 2:

In this part, you will make the buttons functional. There are two buttons:

●​ The ground button in the first room. If the player touches this button, it should open
or close Door 1 depending on the door’s state (if it’s closed, open it, if it’s opened,
close it) every time the player touches the button.
●​ The wall button in the second room. This button is only activated if the player shoots
it with a bullet. Each time the button is activated, it should open or close Door 2
depending on the door’s state (if it’s closed, open it, if it’s opened, close it ).

Both of these features should be achieved using an event system similar to the one we
demonstrated in class.

Part 3:

In this part, you will make the enemies functional. Achieve the following:

●​ The enemies should be stationary and cannot be moved from their location.
●​ The enemies will shoot (“EnemyBullets” prefab) at the direction they're facing if the
player is within 10 units of their vision (raycast in front of the enemies of 10 units).

2
The bullets should self-destruct after 4 seconds or after coming in contact with any
object except for enemies.
●​ The enemy objects should be destroyed if the player shoots them.
●​ In the third room, make it so that if all the enemies have been destroyed, the door
will open itself. This is achievable if you put a manager script on an empty object
that exists in the scene.

Part 4:

In this part, you will make features related to the player object’s HP:

●​ Give the player object a “HP” attribute and its maximum value is 20.
●​ The player will start with maximum HP.
●​ Display the player’s HP using a UI text element (TextMeshPro).
●​ Each time an enemy bullet touches the player, he loses 3 HP and the bullet is
destroyed.
●​ If the player object comes in contact with the “HealthPack” object, restore the
player’s HP to its maximum value and destroy the “HealthPack” object.
●​ If the player’s HP reaches 0 or below, destroy the player object.

3
Notes:

●​ Make the camera object a child of the player object so the camera follows the player
when the player object moves.
●​ Any time you use a Raycast, don’t forget to also draw a debug ray to visualize the
raycast using the function Debug.DrawRay(). You can see the lines if you enable
“Gizmos” in the Unity Editor.
●​ You can move objects for testing, but do not rearrange the layout of the scene.
●​ You can use any documentation or use any of the material from the class that is
available to you.
●​ USING AI GENERATED CODE IS STRICTLY PROHIBITED!!! THERE WILL BE SERIOUS
REPERCUSSIONS FOR CHEATING!!! YOU HAVE BEEN WARNED!!!
●​ I will be grading on whether your game works or not! Make sure your code works
before submitting it!
●​ All tasks can be done using what we’ve learned in class! Good luck!

You might also like