Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

2D Movement Controller (C#)

An asset by leoyzhang
The page banner background of a mountain and forest
2D Movement Controller (C#) hero image

Quick Information

0 ratings
2D Movement Controller (C#) icon image
leoyzhang
2D Movement Controller (C#)

Highly customizable 2D character movement controller written in C#. Designed to serve as a flexible template for game developers, offering a wide array of common platformer mechanics out-of-the-box.

Supported Engine Version
4.0
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
5 days ago
Git URL
Issue URL

Godot 2D Movement Controller (C#)

Overview

This project provides a highly customizable 2D character movement controller for Godot, written in C#. It's designed to serve as a flexible template for game developers, offering a wide array of common platformer mechanics out-of-the-box.

My focus for ths project was to implement a movement controller using programmer-friendly variables like MaxJumpHeight and TimeToMaxJumpHeight that make it intuitive to change values and expect certain results.

Additionally, I added some more features that make it easier to get started on creating environmental movment interactions.

Core Features

  • The Player as a State Machine: An internal state machine handles transitions between being grounded, airborne, and brief "coyote time" moments, as well as managing different phases of a jump (ascent, hang time).
  • Responsive Running & Ground Movement:
    • Define maximum speed and the time it takes to reach it for precise acceleration control.
    • Adjustable ground friction allows for snappy stops or more slippery movement.
  • Nuanced Jumping System:
    • Variable Jump Height: Players can control jump height by how long they hold the jump button.
    • Coyote Time: A small window after walking off a ledge where a jump can still be initiated, improving game feel.
    • Jump Buffering: Inputs made slightly before landing are remembered, making jumps feel more responsive.
    • Hang Time: A configurable period at the jump's apex where gravity's effect is lessened, allowing for more air control and a smoother jump arc.
    • B-Hop (Bunny Hop) Capability: Option to enable a speed boost when jumping immediately upon landing.
    • Multiple Air Jumps (Double Jumps): Easily set the number of jumps allowed while airborne.
  • Dynamic Dashing:
    • Configure the number of dashes available before needing to touch the ground.
    • Set dash speed, duration, and an optional change in velocity when the dash concludes.
  • Precise Air Control:
    • Independent settings for maximum air speed and air acceleration.
    • Configurable air friction for when no movement input is given.
  • Environmental Interactions:
    • Support for different ground materials with different friction values.
    • Collision detection that allow objects like launchpads to interact with player movement
    • Moving platforms that move between two predetermined locations.
  • Prebuilt Gym
    • Includes a set of preconfigured values.
    • Includes a simple gym that showcases all of the movement capabilities.

Getting Started

Download the repository and run the playground.tscn scene.

Highly customizable 2D character movement controller written in C#. Designed to serve as a flexible template for game developers, offering a wide array of common platformer mechanics out-of-the-box.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
2D Movement Controller (C#) icon image
leoyzhang
2D Movement Controller (C#)

Highly customizable 2D character movement controller written in C#. Designed to serve as a flexible template for game developers, offering a wide array of common platformer mechanics out-of-the-box.

Supported Engine Version
4.0
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
5 days ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers