Skip to content

deadlykam/JumpRace3D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JumpRace3D

Introduction of the game:

This is a mobile game where the player races with other AI by jump on floating stages.

Gameplay:

The main objective is to get to the final floating stage which is green in colour and looks different from other stages. On the way there will be other AI racers that will try to reach the final stage before the player. The AI racers can be killed by colliding with them or by breaking some stages. The player dies when falling into the water or colliding with the big floating windmill fan obstacle. There is a booster pick up which helps the player to travel further. Once the player reachs the final stage a new random stage will be generated.

Table of Contents:

Prerequisites

Unity Game Engine

Unity version of the build is 2019.3.15f1. Install Unity game engine from version 2019.3.15f1 or above. Install Unity Hub (recommended) and add Unity version 2019.3.15f1. Once installed then open the latest stable build.


Stable Build

Stable-v1.0.0 is the latest stable build of the game. The apk file can also be found there for running the game in android.


Controls

  1. Unity Editor: Press and hold the left mouse button to move the player forward. Press and hold the left mouse button and move the mouse in x-axis to rotate the player.

  2. Android: Press and hold the screen to move the player forward. Swipe left or right to rotate the player left or right respectively.


Stage

The StageGenerator is responsible for generating a stage. Every stage is randomly generated so no two stages are alike. Everytime before a stage starts it generates a new random stage. Below are previews showing how the stages are being generated.


UML

Sharing some UML diagram to show the hierarchy of some classes and system and a brief description.

1. Character UML: This structure shows how the game character's functionalities are handled.

Character UML

  • BasicCharacter: Handles the movement, rotation, jumping, falling and auto rotation functions of a character.
  • BasicAnimation: Handles all the animation functions of a character. Also enables/disables the ragdoll.
  • Player: Makes the player character move forward or rotate by taking input from the user.
  • Enemy: Makes the enemy character move towards the next stage and also rotates the enemy to face the next stage. Colliding with the player kills the enemy character.
2. Platform UML: This structure shows how the game's platform system funtions.

Platform UML

  • BasicStage: This class sets the type of particle effect to show for the platform when the methods void StageAction() or void StageAction(bool) are called.
  • BouncyStageLong: This class starts the hide countdown process of the platform. Once the countdown process is done the platform is hidden and disabled from the game world. The method void StageAction() starts the countdown process and calls the parent's virtual method as well.
  • BouncyStage: This class handles the animation of the platform. It also shows/hides the booster pickup of a platform and stores the 3D text when the platform is activated. The method void StageAction() plays the animation of the platform if the property bool _hasAnimation is true and calls the parent's virtual method as well.
  • BouncyStageMove: This class moves the platform sideways within a limit. The method void StageAction() calls the parent's virtual method.
  • BouncyStageBreakable: This class starts the breaking up process of a platform. The method void StageAction() instantly starts the breaking process of the platform and calls the parent's virtual method. The method void StageAction(bool) checks if the platform's break up process should be activated or not depending on the bool value and also calls the parent's virtual method.
3. Menu UML: This structure shows how the game's menu system functions.

Platform UML

  • BasicUI: This class shows the menu by calling the method void ShowUI() and hides the menu by calling the method void HideUI(). It shows/hides menus by activating/deactivating the Canvases stored in the field Canvas[] _canvases.
  • EndScreenUI: This class shows the end menu which is the final result of the race. The menu is shown by calling the parent's virtual method void ShowUI() and hidden by calling the method void HideUI() which resets the end menu and calls parent's virtual method.
  • MoveUI: This class slides in/out a menu. The menu is slid in when the method void ShowUI() is called, this also calls the parent's virtual method. The menu is hidden when the method void HideUI() is called but the parent's virtual method is not called from here. This is done so that once the slide out effect is done only then will the menu be hidden.
  • PlayerUI: This class shows the current race position of the player and other racers. It also shows how far the player is in the race. The parent's virtual method void ShowUI() shows the player menu and the parent's virtual method void HideUI() hides the player menu.
4. UI Element UML: This structure shows how the game's UI element system functions.

Platform UML

  • BasicUIEffect: This class calculates and stores the accurate value of Time.deltaTime. The value is stored in the field float _fps and accessed by the property float fps. This value is used by the child classes to get accurate calculations.
  • ToggleUI: This class shows and hides an UI element in a given time interval. The class uses parent's float fps value to calculate the time change.
  • BasicUISpeedEffect: This class calculates and stores the step value which is needed by the child classes for lerpnig. The step value is stored in the field float _step and accessed by the property float step. The accurate calculation of the step value is done by using the parent's field float fps value.
  • TextSizeUI: This class continuously changes the size of a text UI element. The class uses the parent's float step property to lerp between the minimum(float _sizeMin) and maximum(float _sizeMax) size of the text.
  • PopupUI: This class gives a popup effect to an UI element. The class uses the parent's float step property to change the size of the element once by lerping which is from minimum to maximum to minimum and then hide.
  • SideMoveUI: This class moves an UI element from side to side. The class uses the parent's float step property to lerp the UI from the left target(Transform _leftTarget) to the right target(Trnasform _rightTarget). This gives a nice smooth effect of the movement.
  • LoadUI: This class moves the UI element towards its final destination which means it is moved only in one direction. The class uses the parent's float step property to lerp the UI from target1(parent's Transform leftTarget) to target2(parent's Transform rightTarget).
  • SizeUI: This class changes the size of an UI element continuously. The class uses the parent's float step property to lerp between the minimum size(float _minSize) and the maximum size(float _maxSize).

Versioning

The project uses Semantic Versioning. Available versions can be seen in tags on this repository.


Authors


License

This project is licensed under the MIT License - see the LICENSE.md file for details.