PlatformerController2D

An asset by evpevdev
The page banner background of a mountain and forest
PlatformerController2D thumbnail image
PlatformerController2D thumbnail image
PlatformerController2D thumbnail image
PlatformerController2D hero image

Quick Information

0 ratings
PlatformerController2D icon image
evpevdev
PlatformerController2D

This is a platformer class with many tweakable settings which can be used to control a 2D character (think supermario 1).##Features- Double jump- Coyote time- Jump buffer- Hold jump to go higher- Defining jump height and duration (as opposed to setting gravity and jump velocity)- Assymetrical jumps (falling faster than rising)

Supported Engine Version
4.0
Version String
2.0.2
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

PlatformerController2D

A 2D platformer class for godot.

Changelog

Version 1.0.1

  • Updated to Godot 3.4
  • Fixed division by zero error when changing min jump height
  • Other minor fixes

Installation

  1. Add platformer_controller.gd to your project
  2. Type extends PlatformerController2D to the top of your script
  3. Add these input mappings in your project settings (or you can change the input variables in the inspector)
    • "move_left"
    • "move_right"
    • "jump"

Features

  • Double jump
  • Coyote time
  • Jump buffer
  • Hold jump to go higher
  • Defining jump height and duration (as opposed to setting gravity and jump velocity)
  • Assymetrical jumps (falling faster than rising)

Customization / Export variables

Here are the values that you can change in the inspector:

max_jump_height

The max jump height in pixels. You reach this when you hold down jump.

Min Jump Height

The minimum jump height (tapping jump).

Double Jump Height

The height of your jump in the air (i.e. double jump, triple jump etc.).

Jump Duration

How long it takes to get to the peak of the jump (in seconds).

Falling Gravity Multiplier

Multiplies the gravity by this while falling.

Max Jump Amount

How many times you can jump before hitting the ground. Set this to 2 for a double jump.

Max Acceleration

How much you accelerate when you hold left or right (in pixels/sec^2).

Friction

The higher this number, the more friction is on your character.

Can Hold Jump

If this is off, you have to press jump down every time you land. If its on you can keep it held.

Coyote Time

You can still jump this many seconds after falling off a ledge.

Jump Buffer

Pressing jump this many seconds before hitting the ground will still make you jump.
Note: This is only needed when can_hold_jump is off.

Input Variables

input_left
input_right
input_jump
Set these to the names of your actions in the Input Map

This is a platformer class with many tweakable settings which can be used to control a 2D character (think supermario 1).

##Features
- Double jump
- Coyote time
- Jump buffer
- Hold jump to go higher
- Defining jump height and duration (as opposed to setting gravity and jump velocity)
- Assymetrical jumps (falling faster than rising)

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
PlatformerController2D icon image
evpevdev
PlatformerController2D

This is a platformer class with many tweakable settings which can be used to control a 2D character (think supermario 1).##Features- Double jump- Coyote time- Jump buffer- Hold jump to go higher- Defining jump height and duration (as opposed to setting gravity and jump velocity)- Assymetrical jumps (falling faster than rising)

Supported Engine Version
4.0
Version String
2.0.2
License Version
MIT
Support Level
community
Modified Date
1 year 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