This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
godot is NOT on PATH. Use the downloaded binary directly:
/home/thunderrabbit/Downloads/Godot_v4.6-stable_linux.x86_64 --path /home/thunderrabbit/Godot/conswi
Run it in the background so Rob can interact with the running game and send screenshots.
Before running any gh command, run source .gh-token to load the conswi-scoped PAT (GH_TOKEN). Without it, gh falls back to Rob's user-wide token. Not needed for git push/pull (those use SSH).
gh issue view N and gh pr view N --comments fail on this repo with a Projects-classic deprecation GraphQL error. Skip them — go straight to the REST API:
gh api repos/:owner/:repo/issues/N --jq '{title, body, state}'
gh api repos/:owner/:repo/issues/N/comments --jq '.[] | {user: .user.login, created: .created_at, body}'
Role: Skilled Godot Game Designer & Technical Lead.
- Challenge Assumptions — Don't blindly accept instructions if they seem suboptimal or dangerous. Verify the "why" before the "how".
- Seek Understanding — Before making changes, ensure a complete understanding of the system and the user's intent. Ask clarifying questions.
- Strategic Thinking — Focus on long-term maintainability and best practices for Godot 4, not just quick fixes.
- Consent — Don't execute code changes without a clear, shared understanding of the reason.
- Developer (Rob): gameplay mechanics and logic
- Designer (Tariq): aesthetics and audio
- Assistant (conKun): bridge the gap by ensuring code supports the design without becoming spaghetti
Target platform: Mobile (Android / iOS).
See MIGRATION_HISTORY.md for the road-not-taken: a Feb 2026 plan (with Gemini 3 Pro / Antigravity) for a bottom-up git mv-based migration. That plan wasn't followed — the actual migration in this branch was done with Claude in Aug 2025 in-place. The historical doc is preserved for context only.
ConSwi is a swipe-based puzzle game built with Godot Engine 4. The game involves swiping patterns to collect animal tiles across different themed worlds (Dog, Cow, Lion, Monkey, Panda, Rabbit, Tiger, etc.). Players must complete specific swipe patterns to clear tiles and progress through levels.
Note: This project has been migrated from Godot 3 to Godot 4, with all major API changes updated for compatibility.
- Open project in Godot Editor: Launch Godot 4.x and open the
project.godotfile - Test/Play: Press F5 or use the "Play" button in Godot Editor
- Export builds: Use Godot's export functionality with presets defined in
export_presets.cfg - Important: Must use Godot 4.x or later due to API changes from migration
The game supports multiple export targets:
- Android (
AndroidConSwi) - iOS (
iOS) - HTML5 (
HTML ConSwi)
- Set
debug_level = 1in Game.gd for debug mode - Set
fill_level = trueandmax_tiles_avail = 1000for testing - Use
always_play_level_zero = trueto always test level 0
Game Flow Management:
Game.gd- Main game controller, handles level lifecycle, player movement, and game stateGameHUD.gd- Manages UI overlays, buttons, and level information displaySceneSwitcher.gd- Handles transitions between different scenes/screens
Level System:
levels/LevelDatabase.gd- Central registry for all levels across different worldslevels/NormalLevel.gd- Base class for level definitions- Individual level files in
levels/[AnimalName]World/normal_[XX].gd
Swipe Detection:
GameSwipeDetector.gd- Detects and validates player swipe patternshelpers/ShapeDatabase.gd- Defines all valid swipe patterns/shapeshelpers/named_swipes/- Contains specific swipe pattern definitions
World/Tile Management:
helpers/TileDatabase.gd- Manages different animal tile typeshelpers/Helpers.gd- Core utilities for game board managementhelpers/Globals.gd- Global constants, coordinates, and game configuration
G(Globals.gd) - Global constants and helper functionsHelpers- Game board utilities and common functionsSceneSwitcher- Scene managementTileDatabase- Tile type definitionsShapeDatabase- Swipe pattern definitionsLevelDatabase- Level managementSoundManager- Audio system (from addon)
images/world_skins/[animal]/- Animal-specific backgrounds and tilesaudio/bgm/- Background musicaudio/se/- Sound effects (organized by category)levels/[AnimalName]World/- Level definitions per world
The game's core mechanic revolves around pattern recognition:
- Players swipe across tiles to form specific shapes
- Valid swipe patterns are defined in
helpers/named_swipes/ - Successful swipes remove tiles and contribute to level completion
- Different animals/worlds may have different required patterns
- Add shape definition to
helpers/named_swipes/named_swipes.gd - Patterns are defined as arrays representing the swipe path
- Use debug mode to test and capture new swipe coordinates
- Create new level file in appropriate
levels/[AnimalName]World/directory - Follow naming convention:
normal_[XX].gd - Extend from NormalLevel class
- Define required tiles, time limits, and swipe requirements
- Add animal type constant to
helpers/Globals.gd - Create directory structure:
levels/[AnimalName]World/ - Add corresponding images in
images/world_skins/[animal]/ - Register in
LevelDatabase.gd
- Level 0 is designed for quick swipe functionality testing
- Use debug mode flags in Game.gd for development testing
- Test swipe detection by enabling debug output in GameSwipeDetector.gd
Successfully migrated to Godot 4.4.1 - The game now runs without errors.
- File API:
File.new()→FileAccess.open(),file_exists()→FileAccess.file_exists() - JSON handling:
to_json()→JSON.stringify(),parse_json()→JSON.parse_string(),JSON.parse()→JSON.new().parse() - Signal connections:
connect("signal", node, "method")→connect("signal", node.method) - Node types:
Sprite→Sprite2D - Resource management:
instance()→instantiate() - Control properties:
rect_position→position,margin_top→position.y - TextureButton methods:
set_normal_texture()→texture_normal,set_button_icon()→icon - Window/OS API:
OS.get_window_size()→get_viewport().get_visible_rect().size(corrected 2026-05-04: original migration usedget_viewport().get_window().size, which returns the OS window's pixel size — different from Godot 3's design-viewport semantics; the wrong replacement broke layouts on Level Select, World Select, and the LaserGrid debug overlay) - Rendering:
update()→queue_redraw() - Export syntax:
export var→@export var - Onready:
onready var→@onready var - Tool scripts:
tool→@tool - Directory API:
Directory→DirAccess - Dictionary methods:
.empty()→.is_empty() - String constructor:
String()→str() - Project config: Updated version and input maps for Godot 4
- Project config — display/window (discovered post-migration, 2026-05-04):
window/size/width→window/size/viewport_width,window/size/height→window/size/viewport_height,window/stretch/modevalue"2d"→"canvas_items". The Godot 3 names were silently ignored, so the design viewport was falling back to Godot 4's default 1152×648 (16:9 landscape) instead of the intended 1242×2688 portrait — visible only at runtime, not as an error
✅ Game loads successfully
✅ World selection interface functional
✅ No runtime API errors
✅ Sound Manager addon updated
✅ All major systems operational
The ConSwi puzzle game is now fully compatible with Godot 4.x and ready for development.