Skip to content

InvadingOctopus/comedot

Repository files navigation

Comedot

Component-based framework and project template for Godot

Godot+Comedot Logo

The goal 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 and tweaking their parameters in the UI. "Entities" and "Components" are like regular Godot Nodes but for gameplay, so you can combine this framework with any other architecture or paradigm or fetish.

components-tree

  • Includes a library of components for common stuff needed in most 2D games: Different types of player movement, combat, collectibles, interactions, upgrades etc.
  • UI controls like a stats HUD and dynamic buttons for special skills, inventory etc.
  • Template scenes for Logo → Main Menu → Options, Input Remapping, Pause Overlay
  • Save/Load player preferences via a config file with just Settings.any_name = 69
  • A neutron star spoonful of helper functions & debugging tools.
  • Commented & documented code.
  • Free-to-use 3rd-party assets for quick prototyping.

Warning

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 eschews certain conventions like ugly underscores and may change frequently: No backwards compatibility is guaranteed!

Examples

⭐️ The composition architecture lets you do cool shit like putting a GunComponent and MouseRotationComponent on any object and It Just Works:

TreesWithGuns.mp4

⭐️ Implement dynamic gameplay and easily change abilities/buffs at runtime; just add/remove components in simple event handlers, like this example of swapping between platformer physics and flying/overhead movement:

HotSwapping.mp4

📈 There's even kawaii charts for monitoring variables in real-time!

debug-charts

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

These scenes are included in the /Templates/Examples/ folder.

How To Use

Important

Requires Godot 4.4 ~Embrace the Future

  1. Clone this repository; This is a Godot template so you must make a local copy of this entire project for each of your games.
  2. Drag-&-drop nodes from the /Entities/ and /Components/ folders into your scene tree.
    • The /Templates/ folder contains scenes and Entities with preset Components as a quick starting point for various gameplay.
    • The /Scripts/ folder contains code for simple non-Entity nodes.
    • The /UI/ folder contains common UI elements such as a stats HUD, special action buttons, lists for choosing upgrades etc.

Custom Dock Plugin

Tip

🧩 A "component" is any Godot node that:

  • Reacts to events (like player input or collisions).
  • Moves or modifies its parent node or other components.
  • Contains data for other components to use (like character health and other stats).

🪆 An "entity" is a node whose children are components (it may also have non-component children).

🎳 Whenever your game needs an "actor" like the player character or a monster, or an object with "behaviors" that could be reused for other objects, like interactive items or collectible powerups:

Use the included custom dock plugin (the Comedock :) or perform these steps manually:

  1. Create a new Entity node: a Node2D/Sprite2D/CharacterBody2D etc. with the Entity.gd script attached.
  2. Add Component child nodes to the entity. A component is also a Node/Area2D etc. with a script that extends the Component.gd class.
  3. Modify component parameters in the Godot Editor's Inspector.
  4. Save the entity + components tree as a standalone scene file to organize it separately from the main "world" scene and quickly create copies of it anywhere.

Tip

📜 Read HowTo.md to see how to do common tasks or fix common issues.

💬 For more deets, ping Syntaks.io on Discord.


Comedot ©? MMXXV ShinryakuTako@GitHubSyntaks.io@Discord

🤍 THANKS: