G

godot-gdscript-patterns

Паттерны GDScript для Godot 4

Разбирает паттерны GDScript в Godot 4: сигналы, сцены, конечные автоматы, оптимизация. Подключается при создании игр на Godot, реализации игровых систем и изучении практик GDScript.

★ 40,2 тыс. на GitHub Разработка игр в один клик в VibeeCode

Установка

$npx skills add https://github.com/wshobson/agents/tree/156b7a5e7a8b93642628a339ee4039c925b34c7f/plugins/game-development/skills/godot-gdscript-patterns

Ставит скилл в текущий проект, CLI спросит, для каких агентов. С флагом -g - для всех проектов. Нужен Node.js.

Описание автора

Master Godot 4 GDScript patterns including signals, scenes, state machines, and optimization. Use when building Godot games, implementing game systems, or learning GDScript best practices. ---

Godot GDScript Patterns

Production patterns for Godot 4.x game development with GDScript, covering architecture, signals, scenes, and optimization.

When to Use This Skill

  • Building games with Godot 4
  • Implementing game systems in GDScript
  • Designing scene architecture
  • Managing game state
  • Optimizing GDScript performance
  • Learning Godot best practices

Core Concepts

1. Godot Architecture

Node: Base building block
├── Scene: Reusable node tree (saved as .tscn)
├── Resource: Data container (saved as .tres)
├── Signal: Event communication
└── Group: Node categorization

2. GDScript Basics

class_name Player
extends CharacterBody2D

# Signals
signal health_changed(new_health: int)
signal died

# Exports (Inspector-editable)
@export var speed: float = 200.0
@export var max_health: int = 100
@export_range(0, 1) var damage_reduction: float = 0.0
@export_group("Combat")
@export var attack_damage: int = 10
@export var attack_cooldown: float = 0.5

# Onready (initialized when ready)
@onready var sprite: Sprite2D = $Sprite2D
@onready var animation: AnimationPlayer = $AnimationPlayer
@onready var hitbox: Area2D = $Hitbox

# Private variables (convention: underscore prefix)
var _health: int
var _can_attack: bool = true

func _ready() -> void:
    _health = max_health

func _physics_process(delta: float) -> void:
    var direction := Input.get_vector("left", "right", "up", "down")
    velocity = direction * speed
    move_and_slide()

func take_damage(amount: int) -> void:
    var actual_damage := int(amount * (1.0 - damage_reduction))
    _health = max(_health - actual_damage, 0)
    health_changed.emit(_health)

    if _health <= 0:
        died.emit()

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Ещё из wshobson/agents 184

  1. Aaccessibility-complianceв один кликДоступные интерфейсы по WCAG 2.2wshobson/agents★ 40,2 тыс.
  2. Aai-debt-detectorв один кликАудит техдолга после кода от ИИwshobson/agents★ 40,2 тыс.
  3. Aairflow-dag-patternsв один кликПайплайны на Apache Airflowwshobson/agents★ 40,2 тыс.
  4. Aangular-migrationв один кликМиграция с AngularJS на Angularwshobson/agents★ 40,2 тыс.
  5. Aanti-reversing-techniquesв один кликАнти-реверс и защита от отладкиwshobson/agents★ 40,2 тыс.
  6. Aapi-design-principlesв один кликПроектирование REST и GraphQL APIwshobson/agents★ 40,2 тыс.
  7. Aarchitecture-decision-recordsв один кликЗаписи архитектурных решений (ADR)wshobson/agents★ 40,2 тыс.
  8. Aarchitecture-patternsв один кликПаттерны архитектуры бэкенда: Clean и DDDwshobson/agents★ 40,2 тыс.
  9. Aasync-python-patternsв один кликАсинхронный Python: asyncio и паттерныwshobson/agents★ 40,2 тыс.
  10. Aattack-tree-constructionв один кликДеревья атак для карты угрозwshobson/agents★ 40,2 тыс.
Все скиллы wshobson/agents →

Похожие скиллы

  1. Ggame-playtestПлейтесты и QA браузерных игрopenai/plugins★ 7,3 тыс.
  2. Ggame-studioМаршрутизация ранней работы над играмиopenai/plugins★ 7,3 тыс.
  3. Ggame-ui-frontendИнтерфейсы для браузерных игрopenai/plugins★ 7,3 тыс.
  4. Pphaser-2d-gameИгры 2D в браузере на Phaseropenai/plugins★ 7,3 тыс.
  5. Rreact-three-fiber-gameИгры 3D на React Three Fiberopenai/plugins★ 7,3 тыс.
  6. Ssprite-pipelineГенерация 2D-спрайтовых анимацийopenai/plugins★ 7,3 тыс.
  7. Tthree-webgl-gameБраузерные игры на чистом Three.jsopenai/plugins★ 7,3 тыс.
  8. Wweb-3d-asset-pipelineПодготовка 3D-ассетов для браузерных игрopenai/plugins★ 7,3 тыс.
Все скиллы раздела «Разработка игр» →