Loading...
Loading...
Expert blueprint for Metroidvanias including ability-gated exploration (locks/keys), interconnected world design (backtracking with shortcuts), persistent state tracking (collectibles, boss defeats), room transitions (seamless loading), map systems (grid-based revelation), and ability versatility (combat + traversal). Use for exploration platformers or action-adventure games. Trigger keywords: metroidvania, ability_gating, interconnected_world, backtracking, map_system, persistent_state, room_transition, soft_locks.
npx skill4agent add thedivergentai/gd-agentic-skills godot-genre-metroidvaniaMANDATORY: Read the appropriate script before implementing the corresponding pattern.
| Phase | Skills | Purpose |
|---|---|---|
| 1. Character | | Tight, responsive movement (Coyote time, buffers) |
| 2. World | | Interconnected map, biomes, landmarks |
| 3. Systems | | Persistent world state, room transitions |
| 4. UI | | Map system, inventory, HUD |
| 5. Polish | | Effects, atmosphere, environmental storytelling |
# game_state.gd (AutoLoad)
extends Node
var collected_items: Dictionary = {} # "room_id_item_id": true
var unlocked_abilities: Array[String] = []
var map_visited_rooms: Array[String] = []
func register_collectible(id: String) -> void:
collected_items[id] = true
save_game()
func has_ability(ability_name: String) -> bool:
return ability_name in unlocked_abilitiesSceneManager# door.gd
extends Area2D
@export_file("*.tscn") var target_scene_path: String
@export var target_door_id: String
func _on_body_entered(body: Node2D) -> void:
if body.is_in_group("player"):
SceneManager.change_room(target_scene_path, target_door_id)# player_state_machine.gd
func _physics_process(delta):
if Input.is_action_just_pressed("jump") and is_on_floor():
transition_to("Jump")
elif Input.is_action_just_pressed("jump") and not is_on_floor() and GameState.has_ability("double_jump"):
transition_to("DoubleJump")
elif Input.is_action_just_pressed("dash") and GameState.has_ability("dash"):
transition_to("Dash")# map_system.gd
func update_map(player_pos: Vector2) -> void:
var grid_pos = local_to_map(player_pos)
if not grid_map_data.has(grid_pos):
grid_map_data[grid_pos] = VISITED
ui_map.reveal_cell(grid_pos)# breakable_wall.gd
extends StaticBody2D
@export var required_ability: String = "super_missile"
func take_damage(amount: int, ability_type: String) -> void:
if ability_type == required_ability:
destroy()
else:
play_deflect_sound()limit_leftlimit_top