Git Product home page Git Product logo

2d-platformer-hunter's Introduction

2D Platformer Hunter

image
Features video links here
I've also made a short level with it
Implementation of a raycast-based 2D platformer controller in Unity.
Extended from Sebastian Lague's Creating a 2D Platformer series with more customizable options and better modularization.

Requirement

Unity 2018.3.8f1 or later

How to install

Design

The code structure is based on a model that I call Input-Controller-Motor model. Each controller consists of three modules: Input, Controller and Motor. Each module can be replaced with user-customized module to achieve various gameplay mechanics.

  • Input represents the brain of a controller. The brain can be player's input or an AI. Waypoint navigation for moving platform is also a type of Input module.
  • Controller represents the body of a controller. The body decides what a character can do, such as, double jumpping, dasing.
  • Motor represents the physics law of a controller. For example, a character motor collides with obstacles; a platform motor can carry other motors or transforms.

Any other behaviours that do not belong to these three modules should instead be implemented in a different components and listen to events sent by three main modules. For instance, a sprite animation controller that changes sprite when a character jumps should subscribe to OnJump event of the CharacterController.

Features

  • Variable Jump Height
  • On-Slope Movement
  • Air Jump
  • Wall Jump
  • Climbing Area - Ladder/rope climbing behaviour
  • Restricted Climbing Area - Users can separate the actual movable area in climbing state with the trigger area. Controller will be smoothly interpolated from triggered position to restricted area when entering climbing state.
  • One-Way Platform - Add the OneWayPlatform component to the platform which you want it to be One-Way Platform
  • Moving Platform - Including a node editor for editing waypoints.
  • Dash - User is able to customize dash modules that can be applied to a controller.
  • Jump Input Buffering - The jump input will be buffered for a period of time when the character controller is still in the air.
  • Coyote Time - Also known as grace period jumping. It allows players to register jump input in a small period of time even after moving off ledges.
  • Ledge Grabbing
  • Wall Climbing - You can configure whether your controller slides on wall or climbs on walls (just like how Knuckles does)

Documentation

  • The collision layer of the raycaster on a controller should be different from the layer of the gameobject itself, otherwise you fly :D
  • More to be added :D

Materials

rvros - Animated Pixel Adventurer https://rvros.itch.io/animated-pixel-hero

2d-platformer-hunter's People

Contributors

ta-david-yu avatar team-on 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.