Skip to content

Recreating Hollow Knight Player movement with all the knowledge ive learned over the years!!!

Notifications You must be signed in to change notification settings

unityover/HollowKnightGodot

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒŒ Hollow Knight Movement recreated in Godot ๐Ÿ—ก๏ธ

โš ๏ธ Disclaimer

To Team Cherry, the creators of Hollow Knight and Silksong: I sincerely apologize for using any extracted sprites or assets from Hollow Knight in this project. ๐Ÿ™ This is purely a coding exercise to replicate the game's movement mechanics as a learning experience. I am not an artist and have no intention of claiming or redistributing your incredible work. This project is for educational purposes only, and I deeply respect your work. ๐Ÿ’–

๐ŸŒŸ Overview

This project is a recreation of the player movement mechanics from Hollow Knight, a critically acclaimed 2D Metroidvania game, built using the Godot Engine (4.x). ๐ŸŽฎ The goal is to emulate the smooth, precise, and responsive movement of the Knight (and inspired by Hornet from Silksong), including features like 8-way movement, jumping, dashing, wall sliding, and wall jumping. This is a coding-focused project to study 2D platformer mechanics, with a focus on achieving the tight, fluid feel of Hollow Knight. ๐Ÿž

โœจ Features

  • 8-Way Movement ๐Ÿƒ: Smooth horizontal movement with input-based direction. (As of the first upload it just goes left/right w/Jump & slide mechanics)
  • Jumping ๐Ÿฆ—: Precise, snappy jumps with a Hollow Knight-like arc (tuned with gravity ~2000 pixels/sยฒ and jump velocity ~-600).
  • Dashing ๐Ÿ’จ: A quick burst of speed in the facing direction, with a lock on vertical movement.
  • Wall Sliding ๐Ÿง—: Slow descent when holding toward a wall while falling.
  • Wall Jumping ๐Ÿฆ˜: Dynamic leaps off walls with directional pushback.
  • Sprite Flipping ๐Ÿ”„: The player sprite flips horizontally based on movement direction.
  • Animation System ๐ŸŽฅ: State-based animations using AnimatedSprite2D for idle, run, jump (rise/fall), dash, wall slide, and wall jump.
  • Camera System ๐Ÿ“ท: A Hollow Knight-style camera with smooth tracking, room-based limits, and dynamic zoom.

๐Ÿ› ๏ธ Technical Details

  • Engine: Godot 4.x (GDScript) ๐Ÿš€
  • Nodes:
    • CharacterBody2D for physics-based movement.
    • AnimatedSprite2D for frame-based animations from sprite sheets.
    • Camera2D for smooth player tracking and room transitions.
  • Physics โš–๏ธ:
    • Gravity: ~2000 pixels/sยฒ to match Hollow Knight's snappy fall (approximated from Unity's ~-30 to -40).
    • Jump Height: Tuned to cover ~2-3 sprite heights, similar to the Knight.
  • Animation ๐ŸŽž๏ธ:
    • Uses a state machine (enum) to switch between animations (e.g., idle, run, jump_rise, dash).
    • Animations are driven by a sprite sheet (12 FPS for a 12-frame animation lasts 1.0 second, as calculated).
    • Sprite flipping via flip_h for directional facing.

About

Recreating Hollow Knight Player movement with all the knowledge ive learned over the years!!!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • GDScript 100.0%