Description
Changelog
Reviews (0)

A top-down player controller for Godot 4 with 8-direction movement, mouse aim, a dash with i-frames and an afterimage trail, and a follow camera that leads your aim and can shake.

The crosshair in the GIF stands in for your mouse.

Features

  • 8-direction movement on a CharacterBody2D with move_and_slide, with diagonals clamped so moving diagonally is not faster than moving straight.
  • Mouse aim. A weapon pivot points at the cursor every frame and the body flips to face it.
  • A dash in your movement direction, or toward the mouse when you are standing still, with a cooldown and a get_dash_ratio() you can feed to a UI bar.
  • I-frames during the dash, exposed as an is_invincible flag, with a blue tint so you can see them working.
  • Dash juice: an afterimage trail, an anticipation stretch, a landing squash and an expanding ring.
  • Body juice without tweens: a walk and idle bob driven by sin(), and a squash when you stop.
  • A follow camera with smooth exponential follow and a capped lead toward your aim, so you see more of where you are pointing.
  • Camera shake, kick and zoom punch you can trigger from any script: trauma-squared shake with roll, a directional shove, and a short zoom pop.
  • Every tuning number is exported, so you can feel it out in the Inspector while the game runs.

Requirements

  • Godot 4.7 or later, standard build (GDScript only, no .NET needed).
  • Tested on Godot 4.7.2 stable on Windows. Earlier 4.x versions are untested.
  • Uses the Mobile renderer, which needs Vulkan, Direct3D 12 or Metal.

Quick Start

  1. Press F5.
  2. Move with WASD.
  3. Aim with the mouse.
  4. Dash with Space.
  5. Select the Player node and change move_speed or dash_speed in the Inspector, then run again to feel the difference.

Known Limitations

  • Keyboard and mouse only out of the box. Aim reads the mouse position, so right-stick aiming needs a few extra lines.
  • The demo arena has no walls, so collision is not shown. The player is a normal CharacterBody2D and slides along anything on collision layer 1.
  • is_invincible is a flag. Nothing in this project damages the player, so the i-frames only matter once your damage code reads it.
  • No sound. Play your dash sound in _start_dash().
  • Tested on Godot 4.7.2 on Windows only.

License

MIT for the code. See LICENSE.

Third-Party Assets

The knight and sword sprites are from Tiny Dungeon by Kenney, released under CC0 1.0. Details in THIRD_PARTY_ASSETS.md, and the pack's original license is in Assets/Tiles/License.txt.

Learn How It Works

Want to understand how this works instead of just copying it?

CodingQuests teaches you how to build systems like this step by step in Godot, with interactive lessons and real projects.

Source code, integration instructions and issue tracker: https://github.com/CodingQuests/godot-top-down-controller

Changelog for version 1.0.0

2026-10-17 01:26:33

No changelog provided for this version.

Reviews

Top-Down Controller has no reviews yet.

Login to write a review.

Consider supporting the creators!

If you enjoyed this asset consider supporting its creator. Follow the link below.