Component-based framework and project template for Godot
The aim is to be an all-in-one toolkit for 2D games (platformers, shoot-em-ups, RPGs, turn-based strategy or puzzle) where you build scenes by adding components to entities like Lego blocks and tweaking their parameters in the UI. "Entities" are just regular nodes and "components" are also nodes which modify other nodes, so you can mix this framework with any other architecture or programming style, even when combining 2D scenes within a 3D game!
[!IMPORTANT] This is still mostly a private personal project; it's what I'm using to make my own epic games while learning Godot and GDScript as I go. The API may change frequently and no backwards compatibility is guaranteed!
🌳 An example of a player entity's node tree:
⭐️ It lets you do neat tricks like put a GunComponent
and MouseRotationComponent
on any object and It Just Works:
https://github.com/InvadingOctopus/media/assets/11238708/bb03147b-b4b0-4388-ac35-b31b23519bde
⭐️ The composition architecture helps you easily change abilities/buffs/debuffs at runtime; just add/remove components in simple event handlers, like this example of swapping between platformer-style control and flying "top-down" movement:
https://github.com/InvadingOctopus/media/assets/11238708/a067368c-489c-42f1-aedb-b210b5549489
📈 There's even cool charts for debugging variables in real-time!
(if the videos don't display, view on imgur): 1, 2
[!WARNING]
Requires Godot 4.4 ~Embrace the Future ✨
The first time you load this project, there may be errors because Godot will re-import the asset files and set the internal IDs for textures etc. To fix, just close and reopen the project.
🚀 For a quick glance: See the /Templates/Scenes/
folder.
⚙️ To use this framework for your own games:
game-of-the-year-2069
) in your local repository./Entities/
and /Components/
folders to build your scenes.
GunComponent
's pivot point. To modify them, select the component node in the Scene Tree and enable "Editable Children"./Scripts/
folder may be used for any node even if it does not inherit from the Entity
class.[!TIP]
- Make subfolders for your game in the existing folder structure like
/Scenes/YourGame/
or/YourGame/etc/
to organize your own files separately from the framework and avoid accidental conflicts.
🧩 Whenever your game needs an "actor" which has to react to events, like the player character or a monster, or an object with "behaviors" which could be reused for other objects, like interactive items or powerups:
Use the included custom dock plugin (the Comedock :) or perform these steps manually:
Entity
node (a Node2D/CharacterBody2D/Area2D/etc. with the Entity.gd
script attached)Component
child nodes to the entity. A component is also a Node/Node2D/Area2D/etc. with a script which extends the Component
class.[!TIP] 📜 Read HowTo.md to see how to do common tasks like player movement and combat.
💬 For more deets, ping Syntaks.io on Discord.
Comedot ©? MMXXIV ShinryakuTako@GitHub • Syntaks.io@Discord
🤍 THANKS:
- Tilesets: https://kenney.nl/assets/1-bit-pack
- Font: Jayvee Enaguas (HarvettFox96) https://www.dafont.com/pixel-operator.font