Overview
This prompt aims to guide developers in creating a simple Pong game with AI functionality. Beginners and educators in coding will benefit from this structured approach to game development.
Prompt Overview
Purpose: This game aims to provide an engaging single-player experience against an AI opponent in Pong.
Audience: It is designed for casual gamers and coding enthusiasts interested in game development.
Distinctive Feature: The AI paddle intelligently tracks the ball, creating a challenging gameplay experience.
Outcome: Players will enhance their coding skills while enjoying a classic game of Pong against a responsive AI.
Quick Specs
- Media: Text
- Use case: Content Creation, Generation
- Industry: Development Tools & DevOps, Productivity & Workflow, Renewable Energy (Solar, Wind, Hydro)
- Techniques: Decomposition, Role/Persona Prompting, Structured Output
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
No inputs required — just copy and use the prompt.
Example Variables Block
No example values needed for this prompt.
The Prompt
Create a simple 1-player Pong game where the player competes against an AI-controlled paddle.
The AI should effectively react to the ball’s position and attempt to return it.
The game should include:
– A playing field with boundaries.
– A player-controlled paddle on one side (controlled by keyboard input).
– An AI-controlled paddle on the opposite side that moves to intercept the ball.
– A ball that bounces between paddles and boundaries.
– A basic scoring system to keep track of points.
# Steps
1. Set up the game window and drawing area.
2. Implement player paddle control via keyboard input.
3. Implement ball movement and collision detection with paddles and boundaries.
4. Develop AI logic that tracks and moves the AI paddle toward the ball’s vertical position.
5. Add a scoring mechanism for when the ball passes a paddle.
6. Display the score and reset the ball position after a point is scored.
# Output Format
Provide the complete source code for the game in a single programming language, such as:
– Python using Pygame
– JavaScript using HTML5 Canvas
# Notes
– Ensure the AI provides challenging yet fair gameplay.
– Code should be clean, well-commented, and runnable without external dependencies beyond standard libraries or frameworks.
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Choose a programming language for the game.
- Paste the prompt into your coding environment.
- Follow the steps to implement the game features.
- Test the game for functionality and AI performance.
- Refine the code for clarity and comments.
Tips for Best Results
- Set up the game window: Use a library like Pygame or HTML5 Canvas to create a game window with defined width and height.
- Player paddle control: Implement keyboard input to move the player’s paddle up and down within the game boundaries.
- Ball movement and collision: Code the ball’s movement logic, ensuring it bounces off paddles and walls, and detect collisions accurately.
- AI paddle logic: Create an AI that follows the ball’s vertical position, adjusting its movement to intercept the ball effectively.
FAQ
- What is the objective of the Pong game?
The objective is to score points by getting the ball past the opponent's paddle. - How does the player control their paddle?
The player controls the paddle using keyboard input, typically the up and down arrows. - What does the AI paddle do?
The AI paddle tracks the ball's position and moves to intercept it effectively. - How is scoring handled in the game?
When the ball passes a paddle, a point is scored, and the ball resets to the center.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


