Coder Social home page Coder Social logo

magnet-run-3d's Introduction

Magnet-Run-3D

Video Demo
Playable Game

Magnet Run 3D is a tech demo I developed to exercise and practice the 3Cs of game design/development. In this demo you play as a ball that rolls around various objects that have complex gravity sources.

  • All variables which determine the mechanics of the Character(animation speeds, textures, etc), Camera(distances, angles, interpolation speeds, camera target, etc), and Control(jump height, movement speed, gravity, etc) are exposed in the Unity editor/inspector so that game designers could easily tweak and modify the mechanics and game feel.

Character

  • The visuals of the ball and the physics of the ball are modularized and seperated.
    • Physics component of the ball determines position, speed, collisions, etc.
    • Visual component of the ball determines orientation, rolling animations, etc.
      • Calculates the visual rolling speed from the physics component(its movement speed).
      • Gets average of floor normals to determine correct orientation(such as when wall riding or rolling on 2 surfaces at the same time).
      • Uses quaternions to interpolate to the desired orientation from current orientation(in the case of steering the ball).
    • This means that the visual component can be completely replaced by a different visual model(such as a humanoid or creature) and set of animations with ease without distrupting the mechanics of the character.

Camera

  • Orbit camera that follows the player character automatically
    • Automatically determines the direction the player is moving in and smoothly orients itself to face that direction.
    • Detects the direction of gravity on the character to calculate and set the correct orientation.
    • Smoothly interpolates between the current position and the desired position(such as when the direction of gravity changes).
    • Performs a box cast between the proposed camera location and the character to determine if the view would be blocked or if the camera is inside any geometry. If so it will place the camera in front of the blocking geometry.

Control

  • Input is converted to be relative to the camera and direction of gravity allowing for intuitive movement.
  • Movement speed on the ground and in the air is split into 2 variables allowing better tuning of game feel.
  • When moving over an edge, a raycast check is performed and if the slope is small enough the the character sticks the surface rather then flying off the edge.

magnet-run-3d's People

Contributors

realtradam 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.