Skip to content
Skills Library
Programming · Building & coding

2d-development

/2d-development

Develop 2D games in Godot including sprites, tilemaps, cameras, lighting, and parallax backgrounds. Use this skill when building 2D platformers, top-down games, implementing tilemap-based levels, 2D camera systems, day/night cycles, or any 2D-specific game feature.

Repository
skills ↗
Licence
MIT
Last repository change
18.06.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 18.06.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Develop 2D games in Godot including sprites, tilemaps, cameras, lighting, and parallax backgrounds. Use this skill when building 2D platformers, top-down games, implementing tilemap-based levels, 2D camera systems, day/night cycles, or any 2D-specific game feature.

Original author description

Develop 2D games in Godot including sprites, tilemaps, cameras, lighting, and parallax backgrounds. Use this skill when building 2D platformers, top-down games, implementing tilemap-based levels, 2D camera systems, day/night cycles, or any 2D-specific game feature.

How it works

  1. Sprite2D
  2. TileMap
  3. Camera2D
  4. 2D Lighting
  5. Parallax Background
  6. 2D Movement Patterns
  7. Best Practices
Original SKILL.md headings · 224 lines, 527 words
SKILL.md preview
---
name: 2d-development
description: Develop 2D games in Godot including sprites, tilemaps, cameras, lighting, and parallax backgrounds. Use this skill when building 2D platformers, top-down games, implementing tilemap-based levels, 2D camera systems, day/night cycles, or any 2D-specific game feature.
metadata:
  author: godot-dev
  version: "1.0"
---

# 2D Development

## Sprite2D

### Basic Sprite

```gdscript
extends Sprite2D

func _ready():
    texture = preload("res://assets/player.png")
    flip_h = true
    flip_v = true
    modulate = Color(1, 0, 0, 1)  # Red tint
    modulate.a = 0.5  # Semi-transparent
```

### AnimatedSprite2D

```gdscript
extends CharacterBody2D

@onready var sprite = $AnimatedSprite2D

func _physics_process(delta):
    if velocity.length() > 0:
        sprite.play("run")
        sprite.flip_h = velocity.x < 0
    else:
        sprite.play("idle")
```

## TileMap

### Setup

```gdscript
extends TileMap

func _ready():
    var cell_pos = local_to_map(Vector2(100, 100))
    set_cell(0, cell_pos, 0, Vector2i(0, 0))
    var tile_data = get_cell_tile_data(0, cell_pos)
    erase_cell(0, cell_pos)
```

### TileMap Layers

```gdscript
func setup_tilemap():
    # Layer 0: Ground
    # Layer 1: Walls
    # Layer 2: Decoration
    set_cell(0, Vector2i(5, 3), source_id, atlas_coords)
    set_cell(1, Vector2i(5, 3), source_id, atlas_coords)
```

### Custom Data from Tiles

```gdscript
func check_tile_property(cell_pos: Vector2i):
    var tile_data = get_cell_tile_data(0, cell_pos)
    if tile_data:
        var is_dangerous = tile_data.get_custom_data("dangerous")
        if is_dangerous:
            take_damage()
```

## Camera2D

### Basic Camera

```gdscript
extends Camera2D

@export var target: Node2D
@export var smoothing: float = 5.0

func _ready():
    position_smoothing_enabled = true
    position_smoothing_speed = smoothing
    limit_left = 0
    limit_top = 0
    limit_right = 1000
    limit_bottom = 600

func _physics_process(delta):
    if target:
        global_position = target.global_position
```

### Camera Shake

```gdscript
extends Camera2D

var shake_intensity = 0.0
var shake_decay = 5.0

func shake(intensity: float, duration: float):
    shake_intensity = intensity
    var tween = create_tween()
    tween.tween_property(self, "shake_intensity", 0.0, duration)

func _process(delta):
    if shake_intensity > 0:
        offset = Vector2(
            randf_range(-1, 1) * shake_intensity,
            randf_range(-1, 1) * shake_intensity
        )
    else:
        offset = Vector2.ZERO
```

## 2D Lighting

### Point Light

```gdscript
extends PointLight2D

func _ready():
    color = Color(1, 0.8, 0.6)
    energy = 1.5
    texture_scale = 2.0
    shadow_enabled = true
```

### Day/Night Cycle

```gdscript
extends CanvasModulate

var time_of_day = 0.0
@export var day_duration = 120.0

func _process(delta):
    time_of_day += delta / day_duration
    time_of_day = fmod(time_of_day, 1.0)
    var brightness = sin(time_of_day * PI) * 0.5 + 0.5
    color = Color(brightness, brightness, brightness * 0.8)
```

## Parallax Background

```gdscript
extends ParallaxBackground

@export var scroll_speed: float = 100.0

func _process(delta):
    scroll_offset.x += scroll_speed * delta
```

## 2D Movement Patterns

### Top-Down Movement

```gdscript
extends CharacterBody2D

@export var speed = 200.0

func _physics_process(delta):
    var input = Input.get_vector("left", "right", "up", "down")
    velocity = input * speed
    move_and_slide()
```

### Platformer Movement

```gdscript
extends CharacterBody2D

@export var speed = 300.0
@export var jump_force = -500.0
@export var gravity = 1000.0

func _physics_process(delta):
    velocity.y += gravity * delta
    var direction = Input.get_axis("left", "right")
    velocity.x = direction * speed
    if is_on_floor() and Input.is_action_just_pressed("jump"):
        velocity.y = jump_force
    move_and_slide()
```

### Grid-Based Movement

```gdscript
extends CharacterBody2D

@export var tile_size = 32
@export var move_speed = 4.0

var target_position = Vector2.ZERO
var is_moving = false

func _ready():
    target_position = position

func _process(delta):
    if not is_moving:
        var input = Input.get_vector("left", "right", "up", "down")
        if input.length() > 0:
            target_position = position + input * tile_size
            is_moving = true
    if is_moving:
        position = position.lerp(target_position, move_speed * delta)
        if position.distance_to(target_position) < 1:
            position = target_position
            is_moving = false
```

## Best Practices

1. **Use CharacterBody2D** for player/enemies with physics
2. **Use TileMap** for level design
3. **Use Camera2D** for viewport control
4. **Layer organization**: Background, main, foreground, UI
5. **Pixel art**: Set texture filtering to Nearest
6. **Collision layers**: Organize by object type

Versions

The database has no other skills named 2d-development.

Database snapshot: 13.11.2026 · package version 4bdac1558848 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 1003d-development
    Develop 3D games in Godot including meshes, lighting, cameras, environments, and 3D model importing. Use this skill when building 3D scenes, setting up lighting rigs, configuring cameras, importing glTF/FBX models, implementing 3D character controllers, or working with the 3D rendering pipeline.
  • 100unity-2d
    Unity 6 2D game development guide. Use when building 2D games, working with sprites, sprite atlas, SpriteRenderer, tilemaps, 2D physics (Rigidbody2D, Collider2D), 2D lighting, sorting layers, or sorting groups. Based on Unity 6.3 LTS documentation.
  • 100roblox-lighting
    Use when setting up or changing Roblox lighting, atmosphere, day/night cycles, or post-processing effects.
  • 100game-engine
    Expert skill for building web-based game engines and games using HTML5, Canvas, WebGL, and JavaScript. Use when asked to create games, build game engines, implement game physics, handle collision detection, set up game loops, manage sprites, add game controls, or work with 2D/3D…
  • 1002d-essentials
    Use when working with 2D-specific systems — TileMaps, parallax scrolling, 2D lights and shadows, canvas layers, particles 2D, custom drawing, and 2D meshes in Godot 4.3+
  • 100make-2d-platformer-games
    Make beautiful 2D and 3D games of any genre: 3D platformers and adventures (islands, characters, lights, shadows, cameras, three.js looks), 2D platformers, top-down adventures and arena games, breakout and other bouncing-ball games, physics games (stacking, ropes, hinges,…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.