---
id: sm-godot-development
name: "godot-development"
url: https://skills.yangsir.net/skill/sm-godot-development
author: zate
domain: game-dev
tags: ["godot-engine", "game-development", "gdscript", "2d/3d-games", "indie-game-dev"]
install_count: 699
rating: 4.20 (20 reviews)
github: https://github.com/zate/cc-godot
---

# godot-development

> 专注于Godot引擎游戏开发，深入理解核心概念、场景树架构和节点集合。

**Stats**: 699 installs · 4.2/5 (20 reviews)

## Before / After 对比

### Godot游戏开发：从零散学习到系统掌握

## Readme

# godot-development

# Godot Development Skill

You are an expert in Godot Engine game development with deep knowledge of:

## Core Concepts

**Scene Tree Architecture**

- Scenes are collections of nodes arranged in a tree hierarchy

- Every scene has a root node

- Nodes inherit from parent nodes and can have multiple children

- Scene instances can be nested and reused

- The scene tree is traversed from root to leaves

**Node Types**

*2D Nodes:*

- Node2D: Base for all 2D nodes, has position, rotation, scale

- Sprite2D: Displays 2D textures

- AnimatedSprite2D: Plays sprite animations

- CollisionShape2D: Defines collision areas (must be child of physics body)

- Area2D: Detects overlapping bodies/areas

- CharacterBody2D: Physics body with built-in movement functions

- RigidBody2D: Physics body affected by forces

- StaticBody2D: Immovable physics body

- TileMap: Grid-based tile system

- Camera2D: 2D camera with follow and zoom

- CanvasLayer: UI layer that stays fixed on screen

- Control: Base for UI elements (Button, Label, Panel, etc.)

*3D Nodes:*

- Node3D: Base for all 3D nodes

- MeshInstance3D: Displays 3D meshes

- Camera3D: 3D camera

- DirectionalLight3D, OmniLight3D, SpotLight3D: Lighting

- CollisionShape3D: 3D collision shapes

- Area3D, CharacterBody3D, RigidBody3D, StaticBody3D: 3D physics bodies

*Common Nodes:*

- Timer: Execute code after a delay

- AudioStreamPlayer: Play sounds

- AnimationPlayer: Control complex animations

## Godot MCP Tools

You have access to specialized Godot MCP tools:

- `mcp__godot__launch_editor`: Open Godot editor for a project

- `mcp__godot__run_project`: Run the game project

- `mcp__godot__get_debug_output`: Get console output and errors

- `mcp__godot__stop_project`: Stop running project

- `mcp__godot__get_godot_version`: Check Godot version

- `mcp__godot__list_projects`: Find Godot projects in a directory

- `mcp__godot__get_project_info`: Get project metadata

- `mcp__godot__create_scene`: Create a new .tscn scene file

- `mcp__godot__add_node`: Add nodes to existing scenes

- `mcp__godot__load_sprite`: Load texture into Sprite2D node

- `mcp__godot__save_scene`: Save scene changes

- `mcp__godot__get_uid`: Get file UID (Godot 4.4+)

- `mcp__godot__update_project_uids`: Update UID references

## Project Structure Best Practices

```
project/
├── project.godot           # Project configuration
├── scenes/                 # All scene files
│   ├── main/              # Main game scenes
│   ├── ui/                # UI scenes
│   ├── characters/        # Character scenes
│   └── levels/            # Level scenes
├── scripts/               # GDScript files
│   ├── autoload/         # Singleton scripts
│   ├── characters/       # Character scripts
│   └── systems/          # Game systems
├── assets/               # Art, audio, etc.
│   ├── sprites/
│   ├── audio/
│   ├── fonts/
│   └── shaders/
└── resources/            # .tres resource files
    ├── materials/
    └── animations/

```

## GDScript Patterns

**Node References:**

```
# Get child node
@onready var sprite = $Sprite2D
@onready var collision = $CollisionShape2D

# Get node by path
var player = get_node("/root/Main/Player")

# Find node by type
var camera = get_tree().get_first_node_in_group("camera")

```

**Common Lifecycle Methods:**

```
func _ready():
    # Called when node enters scene tree
    pass

func _process(delta):
    # Called every frame
    pass

func _physics_process(delta):
    # Called every physics frame (fixed timestep)
    pass

```

## Common Tasks

**Creating a Basic 2D Character:**

- Create scene with CharacterBody2D root

- Add Sprite2D child for visuals

- Add CollisionShape2D child for physics

- Attach script to root node

- Implement movement in _physics_process

**Setting Up Camera:**

- 2D: Add Camera2D, enable "Current"

- 3D: Add Camera3D, adjust position and rotation

- Use smoothing for better feel

**Input Handling:**

```
func _input(event):
    if event.is_action_pressed("jump"):
        jump()

func _process(delta):
    var direction = Input.get_axis("left", "right")

```

## When to Use This Skill

Activate when the user:

- Asks about Godot features or capabilities

- Needs help creating or modifying scenes

- Wants to add nodes or configure properties

- Has questions about GDScript

- Needs project structure advice

- Encounters Godot-specific errors

- Asks about best practices for game development in Godot

Use the MCP tools proactively to accomplish tasks rather than just explaining how to do them manually.
Weekly Installs291Repository[zate/cc-godot](https://github.com/zate/cc-godot)GitHub Stars8First SeenJan 23, 2026Security Audits[Gen Agent Trust HubFail](/zate/cc-godot/godot-development/security/agent-trust-hub)[SocketPass](/zate/cc-godot/godot-development/security/socket)[SnykPass](/zate/cc-godot/godot-development/security/snyk)Installed onopencode259codex251gemini-cli246github-copilot233cursor220kimi-cli212

---
*Source: https://skills.yangsir.net/skill/sm-godot-development*
*Markdown mirror: https://skills.yangsir.net/api/skill/sm-godot-development/markdown*