Gommand is a command-based framework for Godot 4.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
Gommand is a command framework for Godot 4 that keeps your code clean.
Instead of managing state machines or tangled control flow, you write small focused commands and compose them into sequences, parallel groups, or conditional flows. The scheduler handles execution order and prevents conflicts automatically.
What you get:
- Readable logic: commands have clear names and a single purpose, so the code says exactly what it does
- Declarative style: all your logic lives in one place, no hunting across files to understand what happens
- Composable flows: chain sequences, run things in parallel, add conditions and repeats
- Conflict prevention: subsystem requirements stop commands from clashing
- Input wiring: bind player actions to commands with
ActionTrigger, no boilerplate
extends Node3D
var is_dashing := false
var dash_time := 0.0
var attack_pending := false
func _ready() -> void:
print("Press ui_accept to dash, then attack.")
func _physics_process(delta: float) -> void:
if Input.is_action_just_pressed("ui_accept") and not is_dashing:
is_dashing = true
dash_time = 0.2
start_dash()
if is_dashing:
dash_time -= delta
if dash_time <= 0.0:
is_dashing = false
stop_dash()
attack_pending = true
if attack_pending:
attack_pending = false
attack_target()
func start_dash() -> void:
print("Dash start")
func stop_dash() -> void:
print("Dash end")
func attack_target() -> void:
print("Attack")extends Node3D
var trigger: ActionTrigger
func _ready() -> void:
print("Press ui_accept to run dash + attack sequence.")
var dash_and_attack := SequentialCommandGroup.new([
PrintCommand.new("Dash start"),
WaitCommand.new(0.2),
PrintCommand.new("Dash end"),
PrintCommand.new("Attack"),
])
trigger = (
ActionTrigger
.builder("ui_accept")
.add_on_action_pressed(dash_and_attack)
.build()
)"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." - Martin Fowler
- Core framework
- Command Visualizer
- Documentation
See the open issues for a full list of proposed features and known issues.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.