Overview
This prompt aims to guide programmers in creating a basic action game code with essential features. Beginners and educators in programming will benefit from the structured approach and clear explanations.
Prompt Overview
Purpose: This game aims to provide an engaging action experience through dynamic gameplay mechanics.
Audience: Targeted towards beginner programmers interested in game development and coding fundamentals.
Distinctive Feature: The game incorporates a simple yet effective enemy AI that enhances player interaction and challenge.
Outcome: Players will learn essential programming concepts while enjoying a fun and interactive gaming experience.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Creative Writing & Storytelling, Cryptocurrency & Blockchain
- 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
- [programming language] – Programming Language
Example Variables Block
- [programming language]: Python
The Prompt
Create a basic action game code using [programming language] that includes the following features:
1. Game Loop:
– Implement a game loop that continuously checks for player input and updates the game state.
2. Player Character:
– Define a player character that can move in four directions (up, down, left, right) and perform actions (jump, shoot).
3. Enemy AI:
– Create a simple enemy character that moves towards the player and exhibits basic attack behavior.
4. Collision Detection:
– Implement collision detection between the player, enemies, and any obstacles in the game.
5. Scoring System:
– Add a scoring system that increases the score when the player successfully defeats enemies.
6. Game Over Condition:
– Set a condition for game over, such as the player losing all lives.
**Formatting Guidance**:
– Write the code in a structured format.
– Include comments to explain each section clearly.
– Address any potential improvements or adjustments that could enhance gameplay.
Screenshot Examples
How to Use This Prompt
- [GAME_LOOP]: Continuously checks input and updates state.
- [PLAYER_CHARACTER]: Moves in four directions and acts.
- [ENEMY_AI]: Moves towards player and attacks.
- [COLLISION_DETECTION]: Detects interactions between entities.
- [SCORING_SYSTEM]: Tracks player score for defeating enemies.
- [GAME_OVER_CONDITION]: Defines conditions for ending the game.
- [INPUT_HANDLING]: Manages player controls and actions.
- [LEVEL_PROGRESS]: Controls advancement through game levels.
Tips for Best Results
- Game Loop: Use a while loop to continuously check for player input and update game state.
- Player Movement: Implement functions to handle player movement in four directions and actions like jump and shoot.
- Enemy Behavior: Create an AI function for enemies to track and attack the player when within range.
- Collision Detection: Use bounding box checks to detect collisions between the player, enemies, and obstacles.
FAQ
- What is a game loop in programming?
A game loop continuously checks for player input and updates the game state. - How can a player character move in a game?
The player character can move up, down, left, or right and perform actions like jumping or shooting. - What is enemy AI in gaming?
Enemy AI refers to programmed behaviors allowing enemies to move towards the player and attack. - Why is collision detection important in games?
Collision detection ensures accurate interactions between characters, enemies, and obstacles, enhancing gameplay experience.
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.


