GithubHelp home page GithubHelp logo

grpahics-project-2's Introduction

COMP30019 Project 2 - Accelerated Tubular

This is the second project for the subject COMP30019 (Graphics and Interaction), in the University of Melbourne. Completed by Jack QIAN and Kevin CHEN, the project is a infinite-runner-like game in a procedurally generated, tubular stage and space themed environment. Various visual effects has been applied to the project, and interaction can be done in multiple ways.

The project is built and tested in Unity 5.4.1f1.

Here's a link to the video for demonstration.

Gameplay

Similar to many existing games, the game has a simple yet challenging objective, that is moving forward as far as possible. The distance travelled is recorded as the score of a game, and a player could try to get the highest score possible.

Obstacles will be generated in the tunnel, crushing on them without protection damages the player, the game will finish if the player's HP reaches zero.

There are also items in the tunnel, colliding on the item box will grant the player an item randomly, the player can then use the item to benefit from them. Two of the items in the game are:

  • HealthRecovery: Recovers player's health partially
  • InvincibleBoost: Temporarily speeds up the player and adds protection to the player from damages

Implementation

The game is built with Unity, using C# scripts and custom shaders for desired effects. Implementation detail of major features is included below:

Stage Generation and Movement

The tunnel of the game can infinitely extend, and its shape is randomly selected. This is achieved by generating multiple parts of the tunnel in different shapes, and as the player moves forward, connect a random one to the end of tunnel.

Player movement is done with an origin that follows the tunnel track, using linear interpolation between two points in a track. And moving left/right is done by simply rotating the origin. The origin is also responsible for handling velocity and acceleration, both can be adjusted by public methods.

Camera

First person and third person view are implemented as two cameras as children of player object's transform, so that they always follow the player with a fixed distance. The game supports switching between the cameras by enabling one and disabling the other.

Lighting and Texture

The Phong Illumination Model is applied, with a modified version of the shader from labs, so that it is compatible with Unity built-in light.

Texutres are widely used in the project, along with normal maps used in some materials (such as the tunnel).

Particle Systems

Unity particle systems has been utilized for multiple effect, including the afterburn of the spaceship (size changed with item effect), and the protection of item "InvincibleBoost".

When an item box is collected, and player or cube obstacle gets destroyed, related explosion will be instantiated, also using particle systems.

Fog Effect

To prevent the player noticing the procedural generation of tunnels, and to make the game more challenging, fog effect has been implemented as a part of the custom shader. The shader creates the fog by calculating the distance of the object, and blend the specified fog color with the original color respectively.

Shadow

Shadow is not in the main gameplay, but it is implemented and applied on instruction scene. It uses the custom shader ShadowShader.cg.

Input/Interaction

The game accepts keyboard, touch screen and Accelerometer as input, in order to suit different devices.

  • Keyboard: A and D keys to move left/right, Space key to trigger an item
  • Touch and Accelerometer: Tilt left/right to move respectively, tap the screen to trigger an item

Considering possible different configurations of the accelerometers and player's personal preference, the sensitivity of the accelerometer can be adjusted in the setting page, along with the functionality to recalibrate the accelerometer. A player is able to adjust the setting and try with real time preview of the game.

Credits

grpahics-project-2's People

Contributors

jack9966qk avatar weixuc avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.