- 🏠 Organize Your Project
- 👤 Make a Player Entity
- 🕹️ Add Player Control
- ⚔️ Mortal Comebat
- ⚡️ Add New Functionality
- 🧩 Create New Components
- 🎲 Make a Turn-Based Game
-
Create a new git branch for your game (say
game-of-the-year-2069
) in your local repository, and -
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.
- 💡 You could also use a single
/Comedot/Game/
subfolder for multiple game projects: Create a new git repository in the/Game/
subfolder, and use multiple git branches for each game. This may help experiment with different ideas while keeping the Comedot framework separate, so that any updates or modifications to the framework may be used for all your games.
❗️ Your main game scene must have the /Scripts/Start.gd
script attached to the root node (or any other node as long as it runs before other scripts, just to be safe) so it can initialize the Comedot framework environment and apply global flags etc.
-
Create a
CharacterBody2D
node. -
Attach the
/Entities/Characters/PlayerEntity.gd
script. -
Add other necessary nodes like
Sprite2D
orAnimatedSprite2D
,CollisionShape2D
,Camera2D
and set them up. -
Set the Body's Physics Collision Layer to
players
and the Mask toterrain
. Add other categories as needed.
- 💡 Try one of the templates in
/Templates/Entities/
-
Select the Player Entity.
-
Choose
Instantiate Child Scene
from the context menu. -
Add components from
/Components/Control/
as children of the Entity node, such asOverheadControlComponent.tscn
. -
Add
/Components/Physics/CharacterBodyComponent.tscn
as the last component in the Entity's tree. This component takes the velocity updates from other components and applies them to theCharacterBody2D
.
-
📖 Read the documentation comments in the scripts of each component to see how to use it.
-
❕ If you use the
PlatformerPhysicsComponent
then you must also add thePlatformerControlComponent
andJumpControlComponent
.
-
Add a
FactionComponent
and set the Faction to eitherplayers
orenemies
-
Add a
HealthComponent
-
Add a
DamageReceivingComponent
-
For monsters, add a
DamageComponent
to hurt the player on contact. -
❕ Remember to set the correct Physics Collision Layers and Masks for all bodies, otherwise they will not be able to detect collisions with each other.
-
💡 For the player, you may also add an
InvulnerabilityOnHitComponent
.
When you need more game-specific functionality, you have the following options, in order of ease → power:
-
Select a component in your Scene Tree and enable "Editable Children" to modify its internal sub-nodes, such as a
GunComponent
's pivot point, or collision shapes and timers. Those modifications will only apply to that one specific instance. -
Create a new scene which inherits an existing component's scene, then add new child nodes to it, such as additional graphics for a
GunComponent
. -
Make a subclass of a component's script, e.g.
extends DamageComponent
and add your own features on top of the existing functionality. Override anyfunc
and callsuper.funcName()
to run the original code before or after your code. -
Modify the original scene/script of a component to permanently modify or replace the default functionality. Those modifications will affect all instances of that component.
-
Create your own entirely new components, by creating a new scene and attaching the
Component.gd
script to the root node.
❕ Components are the core of the Comedot flow. Whenever you need a new kind of behavior in your game — e.g. the player needs to climb a wall, or a monster needs a specific movement pattern, or a bullet needs to explode into multiple smaller bullets, or you simply want to attach graphics like a health bar on all characters — you can add that as a new Component:
-
Create a new Scene in the appropriate category subfolder in
/Components/
or create a new subfolder. If your component needs to display visuals, the Root Type must be "2D Scene" which is aNode2D
. If your component only has logic code, the Root Type should beNode
. -
Select the root node of your component scene and add it to the
components
group. This makes it easier to manage multiple components. If the Scene is aNode2D
then also enableGroup Selected Nodes
in the Scene Editor Toolbar. This makes it easier to move your component along with its children in the Entity's scene. -
Right-click the root node » Attach Script. Type
Component
in Inherits and choose one of the base components in Template.
-
Go to Project Settings » Globals. Make sure the
TurnBasedCoordinator
Autoload is enabled. -
In your scene, add a
TurnBasedEntity
. -
Create new components which extend
TurnBasedComponents
. -
Connect player input or a UI control such as a "Next Turn" button to the
TurnBasedCoordinator.startTurnProcess()
function. -
Each turn, all turn-based objects cycle through the following functions:
processTurnBegin()
→processTurnUpdate()
→processTurnEnd()
Your turn-based components must implement one or more of those methods and may connect to each other's signals to build your gameplay.
💬 For more questions, @Syntaks.io on Discord