Code Monkey home page Code Monkey logo

timetraveler's Introduction

TimeTraveler

A video game developed on Unity3D, allowing players running on an ancient Chinese street.

Introduction

Time Traveler is a 3D running game developed by Unity. Players will become time travelers of ancient China. This game allows users to interact with Kinect. Users need to run in front of Kinect to run virtual roles. The game also allows the user to control the speed of the run.

  • Kinect Control Kinect control section is the most distinctive feature of the game. The characters in the game will have the same action as real-life users. If the user runs faster, the character will also speed up. The speed control portion is implemented by calculating the distance between the left knee and the right knee and the time took by the user to switch between the left and right legs. The greater the distance between the knees, the shorter the switching time and the faster the character. In addition, Kinect enables players to make different poses in the game.

  • Game Model There are totally 3 kinds of roads and they will be randomly generated when the player is running. The people and obstacles on the road are also randomly generated. In this way, the game tries to create a changing world by utilizing the same resources.

  • Weather and Time There are 6 skyboxes in the game, including ‘Morning’, ‘Day’, ‘Dusk’, ‘Night’, ‘Rain’ and ‘Snow’. When the skybox is ‘Rain’ or ‘Snow’, particle systems will appear to imitate rain or snow.

  • Background Music and Sound Effects The sound effects of people on the road have 3D surround effect. The background music will be changed according to the current skybox.

Description of the source code

The source code is in the folder ‘Asset/Scripts’. Some parts of the code are not written by me, basically the Kinect part. I have applied a Kinect controller package from Unity store, which is not uploaded here. The code I have written include:

  • GameManager: Define the game state. Act as a state machine.
  • MoveController: It acts as a component of the character. It controls the transform of character, the transform of camera and other things related to the collider of the character.
  • MovingNPCController: Prevent the NPCs on the road to be blocked by something.
  • MyGestureListener: Listening to the ‘MyRun’ gesture from Kinect. It should be used together with the code in ‘Asset/Scripts/KinectScripts’.
  • ObstacleInitializer: A component of road. When the road is newly generated, this code will help to generate obstacles and people on it. Also, it helps the people to make sound effects by using coroutine.
  • Code in ‘Asset/Scripts/GameStateScripts’: Including game state controllers. Each controller is a component of the gameobject GameManager. They are inactive at the beginning of the game, and GameManager will decide which should be active.

Something I did not work with

Since this is a coursework, actually the time is a little limited for me. I have spent too much time on building the scene and making it changeable... So when I realized the due was coming, it was too late for me to develop other parts...

  • UI I tried to work with the UI, but it does not work very well. I did not achieve the "Stop" and "Pause" function. And the score here does not really make sense.

  • Stability of the virtual character For example, if the player is standing still on the ground, the character may float up and down a little.

Screenshots

timetraveler's People

Contributors

enihsuns avatar

Watchers

 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.