From ef38f19f04dd231290a2ae39dea5a3ddf05fc286 Mon Sep 17 00:00:00 2001 From: MegaProxy Date: Wed, 6 Aug 2025 21:52:35 +0000 Subject: [PATCH] Initial commit: Godot idle game project setup with basic player movement --- .gitignore | 22 ++++++++++++++++++++++ CLAUDE.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ project.godot | 19 +++++++++++++++++++ scenes/Main.tscn | 10 ++++++++++ scenes/Player.tscn | 18 ++++++++++++++++++ scripts/Main.gd | 7 +++++++ scripts/Player.gd | 8 ++++++++ 7 files changed, 130 insertions(+) create mode 100644 .gitignore create mode 100644 CLAUDE.md create mode 100644 project.godot create mode 100644 scenes/Main.tscn create mode 100644 scenes/Player.tscn create mode 100644 scripts/Main.gd create mode 100644 scripts/Player.gd diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..689d785 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Godot 4+ specific ignores +.godot/ +*.tmp + +# Assets folder (temporarily ignored) +assets/ + +# Imported translations (automatically generated from CSV files) +*.translation + +# Mono-specific ignores +.mono/ +data_*/ +mono_crash.*.json + +# System/IDE-specific ignores +.DS_Store +.idea/ +.vscode/ +*.swp +*.swo +*~ \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..c85ce45 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,46 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview +This is a Godot 4.3 idle game project. The game uses Godot's Forward Plus rendering method and is configured for 1280x720 resolution. + +## Commands + +### Running the Game +- Open the project in Godot 4.3 Editor +- Press F5 or click the Play button to run the main scene +- Press F6 to run the current scene + +### Development Workflow +Since this is a Godot project, most development happens through: +1. The Godot Editor for scene editing and visual work +2. External text editor/IDE for GDScript files in `scripts/` +3. Asset pipeline through `assets/` subdirectories + +## Architecture + +### Scene Structure +- **Main.tscn**: Root scene that instantiates all game elements +- **Player.tscn**: CharacterBody2D-based player with movement controls +- Scenes reference scripts via `res://scripts/` paths +- Scene UIDs are auto-generated by Godot (e.g., `uid://b4ncr5x8y7kmt`) + +### Script Organization +- All GDScript files go in `scripts/` +- Scripts extend appropriate Godot node types (Node2D, CharacterBody2D, etc.) +- Player movement uses built-in input actions (ui_left, ui_right, ui_up, ui_down) + +### Asset Organization +``` +assets/ +├── sprites/ # 2D graphics and textures +├── sounds/ # Audio files (music, SFX) +└── fonts/ # Font files +``` + +## Important Notes +- The project uses placeholder graphics (PlaceholderTexture2D) for prototyping +- Movement speed is defined as a constant in Player.gd (SPEED = 300.0) +- The `.godot/` directory is auto-generated and should never be edited manually +- Scene files (.tscn) use Godot's text format and can be edited manually if needed, but prefer using the Godot Editor \ No newline at end of file diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..9152bff --- /dev/null +++ b/project.godot @@ -0,0 +1,19 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the properties are organized in sections here. + +[application] + +config/name="IdleGame" +run/main_scene="res://scenes/Main.tscn" +config/features=PackedStringArray("4.3", "Forward Plus") +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=1280 +window/size/viewport_height=720 + +[rendering] + +renderer/rendering_method="forward_plus" \ No newline at end of file diff --git a/scenes/Main.tscn b/scenes/Main.tscn new file mode 100644 index 0000000..110f886 --- /dev/null +++ b/scenes/Main.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=3 format=3 uid="uid://b4ncr5x8y7kmt"] + +[ext_resource type="Script" path="res://scripts/Main.gd" id="1_0xvmr"] +[ext_resource type="PackedScene" uid="uid://dxqwp3y8r4ktm" path="res://scenes/Player.tscn" id="2_1yx8k"] + +[node name="Main" type="Node2D"] +script = ExtResource("1_0xvmr") + +[node name="Player" parent="." instance=ExtResource("2_1yx8k")] +position = Vector2(640, 360) \ No newline at end of file diff --git a/scenes/Player.tscn b/scenes/Player.tscn new file mode 100644 index 0000000..99a240d --- /dev/null +++ b/scenes/Player.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=4 format=3 uid="uid://dxqwp3y8r4ktm"] + +[ext_resource type="Script" path="res://scripts/Player.gd" id="1_hqxmv"] + +[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_1"] +size = Vector2(64, 64) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_1"] +size = Vector2(64, 64) + +[node name="Player" type="CharacterBody2D"] +script = ExtResource("1_hqxmv") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = SubResource("PlaceholderTexture2D_1") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_1") \ No newline at end of file diff --git a/scripts/Main.gd b/scripts/Main.gd new file mode 100644 index 0000000..3dbf210 --- /dev/null +++ b/scripts/Main.gd @@ -0,0 +1,7 @@ +extends Node2D + +func _ready(): + print("Game started!") + +func _process(_delta): + pass \ No newline at end of file diff --git a/scripts/Player.gd b/scripts/Player.gd new file mode 100644 index 0000000..acd02e6 --- /dev/null +++ b/scripts/Player.gd @@ -0,0 +1,8 @@ +extends CharacterBody2D + +const SPEED = 300.0 + +func _physics_process(_delta): + var direction = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down") + velocity = direction * SPEED + move_and_slide() \ No newline at end of file