A Godot 4.6 prototype for a 2D platformer built around reusable entity/component architecture.
This repository contains a small platformer prototype with:
scenes/world.tscnas the main scene- a player entity under
scenes/Entities/player.tscn - component-based entity logic in
Scripts/Entity - reusable platform and attack scenes
- tile-based level assets and one-way platforms
- Godot Engine 4.6 (or compatible 4.x version)
- Launch Godot.
- Open the project folder:
2dPlatformer-prototype. - Run the main scene or press
F5.
The input actions are defined in project.godot:
move_right- D or Right Arrowmove_left- A or Left Arrowjump- P or Spaceattack- O or 7
project.godot- Godot project settings and input mapscenes/world.tscn- main level scenescenes/Entities/player.tscn- player entity sceneScripts/Entity- base entity scripts and component loadingScripts/others- world logic and utilities likekill_zone.gdResources/PlayerStats.tres- player stats resourceassets/- art assets and tilesets
This project uses a lightweight ECS-style system built with Godot nodes:
Entityobjects load childComponentnodes from apropertiesfolder.- Each
Componenthas aninit(entity)andprocess(delta)lifecycle method. - The entity iterates over active components in
_physics_process, so behavior is split into reusable pieces like movement, gravity, and attacks. - Components can be enabled or disabled at runtime, making the entity behavior modular and easier to extend.
- The game uses
res://scenes/world.tscnas the startup scene. - The player scene includes movement and gravity components.
- This repository is intended as a prototype and starting point for further 2D platformer development.