Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
This is a Godot 4 game development project called "Metropolis". The project follows Godot's standard directory structure and conventions.
Sign in to like and favorite skills
This is a Godot 4 game development project called "Metropolis". The project follows Godot's standard directory structure and conventions.
IMPORTANT: Always provide options and ask for confirmation before implementing solutions. When the user requests a feature or mentions a problem:
PREFERRED: Use
@export variables for node references instead of complex code to find nodes:
get_child(0), recursive searches, etc.Example:
# ✅ GOOD - Clean and simple @export var interaction_area: Area3D @export var mesh_node: Node3D # ❌ AVOID - Complex node finding @onready var interaction_area = find_child("InteractionArea") @onready var mesh_node = get_child(0).get_child(1)
var health: int = 100)@export for properties that should be editable in the editor@onready for node references that are initialized when the node enters the scene treescenes/ directory by categorylevels/ directoryscenes/players/scenes/enemies/scenes/ui/scenes/environment/signal health_changed(new_health: int)player.health_changed.connect(_on_player_health_changed)@export variables for node references and assign them in the editor
# Export node references - assign these in the Godot editor @export var build_area: Area3D @export var interaction_area: Area3D @export var chest_mesh: Node3D
if build_area: build_area.body_entered.connect(_on_build_area_entered) else: print("Warning: build_area not assigned in editor")
@onready var only for child nodes that are guaranteed to exist in the scene treeget_child(0), find_child(), or searching through node hierarchies_physics_process() for movement and physicsmove_and_slide() for character movementvelocity property before calling move_and_slide()preload() for resources that are always neededload() for resources that may be loaded conditionallyextends CharacterBody3D @export var speed: float = 5.0 @export var jump_velocity: float = 4.5 var gravity = ProjectSettings.get_setting("physics/3d/default_gravity") func _physics_process(delta): if not is_on_floor(): velocity.y -= gravity * delta if Input.is_action_just_pressed("ui_accept") and is_on_floor(): velocity.y = jump_velocity var input_dir = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down") var direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized() if direction: velocity.x = direction.x * speed velocity.z = direction.z * speed else: velocity.x = move_toward(velocity.x, 0, speed) velocity.z = move_toward(velocity.z, 0, speed) move_and_slide()
# Signal declaration signal health_changed(new_health: int) signal player_died # Signal connection func _ready(): health_changed.connect(_on_health_changed) func _on_health_changed(new_health: int): print("Health is now: ", new_health)
Input.is_action_pressed() for continuous inputInput.is_action_just_pressed() for single-frame inputInput.get_vector() for 2D directional input_ready() over _enter_tree() unless early initialization is needed_physics_process() for physics-related updates_process() for visual updates and UIcall_deferred() for operations that should happen after physicsassert() statements for debugging and validationprint(), print_rich(), or push_warning()When suggesting code, prioritize Godot 4 best practices and ensure compatibility with the engine's latest features and conventions.