add-mechanic
SolidAdd game mechanics with correct GDScript 4.x patterns -- movement, health, inventory, save/load
AI & Automation 33 stars
9 forks Updated 2 weeks ago Apache-2.0
Install
Quality Score: 86/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Add Mechanic
Add game mechanics using correct GDScript 4.x syntax. Prevents common LLM mistakes with outdated GDScript 3.x patterns.
## GDScript 4.x Syntax Rules
These changed from Godot 3 to 4. LLMs frequently generate the OLD syntax:
| Correct (GDScript 4.x) | Wrong (GDScript 3.x -- will error) |
|---|---|
| `@export var speed: float = 200.0` | `export var speed = 200.0` |
| `@onready var sprite = $Sprite2D` | `onready var sprite = $Sprite2D` |
| `signal health_changed(new_hp: int)` | `signal health_changed` (no typed params) |
| `func _ready() -> void:` | `func _ready():` (return type optional but preferred) |
| `velocity = Vector2(...)` then `move_and_slide()` | `move_and_slide(velocity, Vector2.UP)` (args removed in 4.x) |
| `super()` | `.method()` for parent calls |
| `await get_tree().create_timer(1.0).timeout` | `yield(get_tree().create_timer(1.0), "timeout")` |
| `%UniqueNode` | `get_node("path/to/node")` when unique name is set |
## Movement Patterns
### Platformer Movement
```gdscript
extends CharacterBody2D
@export var speed: float = 300.0
@export var jump_velocity: float = -400.0
@export var gravity: float = 980.0
func _physics_process(delta: float) -> void:
# Gravity
if not is_on_floor():
velocity.y += gravity * delta
# Jump
if Input.is_action_just_pressed("jump") and is_on_floor():
velocity.y = jump_velocity
# Horizontal movement
var direction := Input.get_axis("move_left", "move_right")
velocity.x = direc...
Details
- Author
- n24q02m
- Repository
- n24q02m/better-godot-mcp
- Created
- 6 months ago
- Last Updated
- 2 weeks ago
- Language
- TypeScript
- License
- Apache-2.0
Integrates with
Bundled in these plugins
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
godot-gameplay-scripter
Writes Godot 4 gameplay code: GDScript 2.0, C# interop, node composition and type-safe signals. Use when structuring Godot scenes or debugging signal wiring. Not for netcode - use godot-multiplayer-engineer.
4 Updated 2 days ago
poorvith-mp AI & Automation Listed
godot-gameplay-scripter
Writes Godot 4 gameplay code: GDScript 2.0, C# interop, node composition and type-safe signals. Use when structuring Godot scenes or debugging signal wiring. Not for netcode - use godot-multiplayer-engineer.
4 Updated 2 days ago
prvthmpcypher