Baltor Get started

Gallery / Godot components

Top-down eight-way movement with acceleration and friction

In your harnessGodot componentMIT

Move a CharacterBody2D in eight directions with acceleration, friction, a reversal boost, optional d-pad snapping and a facing sector index for animation.

Files, names only

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • baltor_test.gd
  • component.json
  • example.tscn
  • inspect_gdscript.py
  • run_tests.gd
  • test_package.py
  • tests/test_top_down_movement_2d.gd
  • top_down_movement_2d.gd
  • verification/native.json

Full files in your harness.

What it takes and gives

Class
BaltorTopDownMover2D, extends CharacterBody2D
Methods
set_input(direction: Vector2) -> void; get_input() -> Vector2; get_facing() -> Vector2; get_facing_index(sectors: int = 8) -> int; step(delta: float) -> Vector2
Signals
facing_changed
Exports
max_speed, acceleration, friction, turn_boost, snap_eight_directions, use_input_actions, action_left, action_right and 2 more
Placement
res://baltor/godot_components/top_down_movement_2d/

Limits. Set the body's motion_mode to Floating for top-down games (the example scene does). No dodge, knockback or terrain speed modifiers; combine with the dash and knockback components. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.

Details

Kind
Godot component
Engine
Godot 4.3 or later
Files
12 files, 78.5 KB
Licence
MIT
Declared effects
reads files, runs commands
Checked with
Godot 4.7.2, headless
Checks
godot parse check only, godot gdscript tests, godot tests reject gutted component, godot editor import, godot contract reflection, godot example scene, godot readme usage compiles
Techniques
acceleration and friction velocity model, input vector clamping, angle sector snapping
Tags
top down, movement, characterbody2d, eight way, acceleration, rpg, twin stick
Identity
library.supply.creative_originals.1e05b74db20a10ee28b0454c.95b696cbf82cd9ec
Version
95b696cbf82cd9ec87d3d5f7b1d41df74bfa2d18d79e265f671835900790410c

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.