Component-based framework and project template for 2D games in the Godot engine
Important
This is still mostly a private personal project; it's what I'm using to make my own awesome games while learning Godot and GDScript as I go.
⭐️ It lets you do stuff like put a GunComponent
and MouseRotationComponent
on any object and It Just Works:
⭐️ One of the best benefits of "composition" is the ability to easily add and remove abilities/buffs/debuffs at runtime, like this example of swapping between platform movement and flying movement:
(darn GitHub, if the images do not animate, click on them to go to the Imgur pages)
🚀 For a quick glance: See one of the scenes in the /Templates/Scenes
folder.
⚙️ To use this framework for your own games:
- Clone this repository to your local storage (this entire Godot project)
- Make a subfolder for your game in the
/Games/
folder (say/Games/EldenRing2D/
) - Drag-and-drop nodes from the
/Entities/
and/Components/
etc. folders to build your scenes, like Lego blocks or puzzle pieces.- Some components have sub-children, like a
GunComponent
's pivot point. To modify them, select the component node in the Scene Tree dock and enable "Editable Children". - The
/Scripts/
folder can be used for any node even if it is not inherited from theEntity
class.
- Some components have sub-children, like a
🧩 Whenever you want to add an object or "actor" to your game which has to react to events, or is made up of "behaviors" which could be reused for other objects:
- Create a new
Entity
scene or node (a Node2D/CharacterBody2D/Area2D with theEntity.gd
script attached) - Add
Component
child nodes to the entity. A component is a Node/Node2D/Area2D etc. with a script which extends theComponent
class. - Modify component parameters in the editor's inspector.
💬 For more details, bug Syntaks.io on Discord.
©? MMXXIV ShinryakuTako@GitHub / Syntaks.io@Discord