Using Claude AI Projects for Game Development with Solar2D
I’m loving Solar2D, I’m sharing information with fellow developers about my experience using Claude AI (Opus), Claude Projects, and Solar2D.
I signed up for the $200 per month version and have learned a lot about how to use it effectively. You can help the Claude project get smarter by using a combination of Project Memory, Project Instructions, and Project Files. This is powerful because you can start conversations associated with the project, and if you need to start another conversation, Claude remembers your foibles from the previous conversation’s development and actually performs better!
Here’s what I have been doing at a high level:
Project Memory
Project Memory provides Claude with persistent context about your project. Here’s an example of how I structure mine:
Purpose & Context
Jeff is developing “Gettysburg,” a Civil War strategy game … high-level description follows.
Current State
The game is in active development with multiple systems … high-level description of state.
Key Learnings & Principles
Jeff values direct, accurate technical guidance. It’s crucial to state limitations clearly rather than making assumptions … high-level description of key coding principles.
Approach & Patterns
Development follows a systematic approach with feature branches merged into the main codebase using git … high-level description of approach and patterns.
Tools & Resources
The project uses Solar2D framework for cross-platform development … high-level description of the tools and resources.
Other Instructions
ARW means Analyze, Report, and Wait for instructions … specific instructions to Claude. One of these for me is to be sure that the project is being used. I asked Claude in this section to always call me sir.
Project Instructions
Project Instructions are directives that tell Claude how to behave. For example:
- If you are getting close to your 200K token limit, let me know.
Project Files
Project Files give Claude reference material without exposing every source listing. This is faster, more efficient, and better for security. I include:
- An interface document
- A program flow document
- A general project knowledge document
Here’s an example from my project knowledge document:
3. GLOBAL GAME OBJECT
The `game` variable is global and accessed throughout:
Key Methods:
game:getMap() -- Returns Map object
... etc.
Results
Using this approach with Claude (Opus), I was able to produce code to save and then load a game. I wrote zero code—I just copied and pasted the code that Claude produced, and it worked!
A Word of Caution
Claude can sometimes lose its mind. You can usually tell when this happens. I have adapted my git strategy so that I can easily go back to a safe place.
Conclusion
So far, Claude (Opus) at $200 per month is worth it and has saved me a whole lot of time!
Happy programming!