Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

dragonruby

verified

This skill should be used when the user asks to "create a game", "make a game", "game development", "dragonruby", "drgtk", "game loop", "tick method", "sprite rendering", "game state", or mentions args.outputs, args.state, args.inputs, coordinate system, collision detection, animation frames, or scene management. Should also be used when editing DragonRuby game files, working on 2D game logic, or discussing game performance optimization.

View on GitHub

Marketplace

claude-ruby-marketplace

hoblin/claude-ruby-marketplace

Plugin

dragonruby

game-development

Repository

hoblin/claude-ruby-marketplace
13stars

plugins/dragonruby/skills/dragonruby/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/hoblin/claude-ruby-marketplace/blob/main/plugins/dragonruby/skills/dragonruby/SKILL.md -a claude-code --skill dragonruby

Installation paths:

Claude
.claude/skills/dragonruby/
Powered by add-skill CLI

Instructions

# DragonRuby Game Toolkit

This skill provides comprehensive guidance for building 2D games with DragonRuby Game Toolkit (DRGTK). Use for game loop implementation, sprite rendering, input handling, collision detection, animation, and scene management.

## Quick Reference

### Basic Game Structure

```ruby
def boot args
  args.state = {}
end

def tick args
  # Called 60 times per second
  args.state.player ||= { x: 640, y: 360, w: 50, h: 50, path: 'player.png' }

  # Handle input
  args.state.player.x += 5 if args.inputs.right
  args.state.player.x -= 5 if args.inputs.left

  # Render
  args.outputs.sprites << args.state.player
end
```

### Key Concepts

| Concept | Purpose |
|---------|---------|
| `def tick(args)` | Main game loop (60 FPS) |
| `args.outputs` | Render sprites, labels, primitives |
| `args.state` | Persistent game data storage |
| `args.inputs` | Keyboard, mouse, controller input |
| `args.grid` | Screen dimensions (1280x720) |
| `Geometry` | Collision detection helpers |

### Coordinate System

- **Screen**: 1280x720 pixels
- **Origin**: Bottom-left (0, 0)
- **Y-axis**: Increases upward

```
(0, 720) ─────────────── (1280, 720)
    │                        │
    │     1280 × 720         │
    │                        │
(0, 0) ─────────────── (1280, 0)
```

## Rendering Primitives

Use `args.outputs.primitives` for FIFO (first-in, first-out) render order control.

### Sprites (Images)

```ruby
args.outputs.primitives << {
  x: 100, y: 100, w: 64, h: 64,
  path: 'sprites/player.png',
  angle: 45,
  anchor_x: 0.5, anchor_y: 0.5,
  r: 255, g: 255, b: 255, a: 255,
  flip_horizontally: false
}
```

### Labels (Text)

```ruby
args.outputs.primitives << {
  x: 640, y: 360,
  text: "Score: #{args.state.score}",
  size_px: 22,
  anchor_x: 0.5, anchor_y: 0.5,
  r: 255, g: 255, b: 255
}
```

### Solids and Borders

```ruby
# Filled rectangle (use primitive_marker: :solid)
args.outputs.primitives << {
  x: 0, y: 0, w: 100, h: 100,
  r: 255, g: 0, b: 0,
  primiti

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
5801 chars