top of page

3D Platformer

Game.png

This is a single-player three-dimensional platformer game. The player can move to the left, right, forwards and backwards using WASD keys. The player can jump using the space key and attack using the right mouse button. The purpose of the game is to collect all of the gold that is in the level. The players progress in collecting this gold is shown in the upper left corner of the screen. The player has a certain amount of health and this is represented by a health bar above the player's head. The player loses health by getting hit by an enemy. The player can gain back health by picking up a potion. If the player runs out of health, the game will restart.

The model for our character was created from scratch using 3DS. We used guides for the front, side, and top of the player, and from there created, modeled and textured the player.

PlayerModel3DS.png

The links to the left are to youtube videos which show the jump and running animations that were found in Mixamo to animate the player, and a video of the jump and punching animations in the actual 3D platformer game.

The code snippet to the right is the update function from the PlayerController script. This method controls the speed and direction of the movement of the player, as well as defines the parameters of the animations which then causes the player's animations to be played.

PlayerControllerUpdate.png
Attack.png
Hurt.png

These code snippets are the Attacking, Hurt and HurtandDie methods from the PlayerController script. These methods are called throughout different scripts in the game when the specific animations of Attack, Hurt, and Die need to be played throughout the game.

HurtAndDie.png
HealthPickup.png
GoldPickup.png

The code snippets to the left show the OnTriggerEnter methods for the gold pickup and the potion pickup. The top method is for the potion pickup. This method will heal 20% of the players health, create an effect and then make the pickup disappear. The bottom method is for the gold pickup. This method will update the quantity of gold collected by the player.

These scripts to the right are the HealthBar and the HealthManager scripts. The HealthBar script creates two methods which allow for the health bar's size to be set based on a float, and for the health bar's color to be set. In the HealthManager script, the player's health is updated whenever the player is hurt or healed, and the HealthBar's size is updated to represent the amount of the player's health remains. The HealthManager script also calls the Hurt and HurtandDie methods that are created in the Player Controller.

HealthBarScript.png
HealthManagerScript.png
PushScript.png

This script to the left allows for the player to push GameObjects with rigid bodies within the game, like a barrel. This script is necessary because of the CharacterController that is present on the player.

bottom of page