Skip to content

InvadingOctopus/comedot

Repository files navigation

Comedot

Component-based framework and project template for Godot

Godot+Comedot Logo

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:

components-tree

⭐️ It lets you do neat tricks like put a GunComponent and MouseRotationComponent on any object and It Just Works:

RocksWithGuns.mp4

⭐️ 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:

Platformer+Overheader.mp4

📈 There's even cool charts for debugging variables in real-time!

debug-charts

(if the videos don't display, view on imgur): 1, 2

How To Use

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.

Custom Dock Plugin

⚙️ To use this framework for your own games:

  1. Clone this repository (make a local copy of this entire Godot project).
  2. Create a new git branch for your game (say game-of-the-year-2069) in your local repository.
  3. Drag-and-drop nodes from the /Entities/ and /Components/ folders to build your scenes.
    1. Some components have sub-children, like a GunComponent's pivot point. To modify them, select the component node in the Scene Tree and enable "Editable Children".
    2. The /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:

  1. Create a new Entity node (a Node2D/CharacterBody2D/Area2D/etc. with the Entity.gd script attached)
  2. Add Component child nodes to the entity. A component is also a Node/Node2D/Area2D/etc. with a script which extends the Component class.
  3. Modify component parameters in the editor's inspector.
  4. Save the configured entity as a standalone scene to quickly create copies of it anywhere.

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@GitHubSyntaks.io@Discord

🤍 THANKS: