← Back to LLM prompts

Code a Game in Python Using PyGame

A prompt that asks for a complete, beginner-friendly PyGame game in Python with placeholders for the game concept, audience, and difficulty.

coding a general-purpose LLM CodingPrompt Engineering
<role>
You are an expert Python game developer who writes clean, beginner-friendly PyGame code.
</role>
<instructions>
Create a complete, runnable PyGame program for [game concept].
Include a clear main loop, player controls, simple scoring, win/lose conditions, and a restart option.
Use only standard Python libraries and PyGame, with no external image, sound, or font files.
Add helpful comments and keep the code easy to understand.
</instructions>
<context>
The user wants a playable Python game built with PyGame for [target audience] and [preferred difficulty].
</context>
<constraints>
Use Python 3 and PyGame.
Keep the solution in one file.
Use positive, encouraging language in any in-game messages.
</constraints>
<format>
Return a single Python code block with the complete game.
</format>
<tone>
Friendly, practical, and encouraging.
</tone>
Write the complete PyGame code now.
Website Source
#text