This repo is mainly built for the final project of CPSC6820-3D-Game-programming. In our project we use Unity as our development game engine. Website for this repo: https://mwfj.github.io/Final_Project_in_3D_Game/
In 04/09 updates we add a random maze and a boss room. But currently no boss in it. We will put adds in the maze and boss in the room in next updates.
At this patch, the way connected to the boss room will open after click on all three ‘switches’. There isn’t a finish condition yet, because no boss there.
modify the code in Player.cs, where I change RayCast to LineCast for detecting the camera collision
change the layer of wall from “default” to “Wall”
Set collision layer in Player.cs to “wall” in Unity Engine
Change scene name to “Main”
Add Character Buff Utility
Add Unity-Chan Weapon Master assets package. Implementing jump function.
Add new texture from Cartoon texture pack.
Animation
folderThe boss creation is little complicated, when the main character turn all the switch on(3 in this game), boss room will open, and the location of door will automatically create a box collider to detect whether the main character enter the boss room or not. When the main character first enter the boss room, it will trigger this collider and boss will generate in the boss room.
Add world space canvas to the enemy prefab, and change the fill account by the health point of the enemy.
If health equals 0, play the dying animation and destroy the object after the animation.
And the boss health bar will use the camera space, and is located at the top left of the screen. It will be activated when the boss is generated.
If we just set the canvas as a sub object of the enemy, the health bar will rotate with the enemy. We want it always face to our camera, so we add a script to dynamically detect the rotation and make sure the health bar is perfectly displayed.
Detection
We use collision detection on the weapon model to check the attack. If the weapon hits the enemy, it will have an collision event.
Add collision trigger on the weapon. Using onTriggerStay to check the attack the collision for the enemy with a delay have the best performance. Because sometimes enter and leave will not occur at the same time as the animation event change the attacking stats. So trigger the attack count and then delay the next attack until current animation is finish will be the best.
Hit Box
We should add additional box collider to check the attack. Because of the NaveMesh, some times the Weapon may not really attack on the enemy model, so a little bigger hit box should be added. This will improve the use experience.
There has two background sound in the game, when the main character in the maze, the game will play relatively soothing background music.
However, when the main character entered the boss room, the concert became relatively intense in order to give the player a sense of tension.
Moreover, when boss room opened, it will have sound effect to describe it.
When the main character kill boss, the background music will change to victory music.
Because the time limit, I only added sound effects for the main character and boss. When player run, attack and jump, it will have sound effect. When boss roar(introduce animation) and attack, it will have sound effect. We will add sound effect for all character in the future.
unitypackage
to the Google DriveLink is post on the Readme of the main page.