បង្កើត game បែប top-down open-world ក្នុង file HTML តែមួយជាមួយ prompt វែងមួយ
ប្រើ prompt វែងដែលរៀបរាប់បានល្អតែមួយ គឺអាចបង្កើត game បែប top-down ក្នុងក្រុងបានយ៉ាងឡូយក្នុង file HTML តែមួយ។
របៀបប្រើ
- Copy prompt ហ្នឹងទុក។
- យកទៅ paste ក្នុង Claude ឬ AI model ខ្លាំងៗផ្សេងទៀត។
- Save ចម្លើយដែលបានជា file HTML រួចបើកវាក្នុង browser។
- សាកល្បងលេងមើល ហើយបើកន្លែងណាដើរមិនស្រួល ប្រាប់ឲ្យ AI ជួយកែឲ្យ។
# BUILD CHALLENGE: MINI GTA-STYLE OPEN WORLD GAME
You are an expert game developer, creative coder, gameplay designer and JavaScript engineer.
Build a fully playable, visually impressive mini open-world city game inspired by classic GTA-style top-down games.
Your entire game must be delivered as **ONE SINGLE SELF-CONTAINED HTML FILE**.
## STRICT TECHNICAL REQUIREMENTS
Output exactly one HTML file.
Use HTML, CSS and vanilla JavaScript.
No external images, textures, fonts, audio files or assets.
No external libraries, frameworks, CDNs or APIs.
Generate all graphics using Canvas 2D.
Generate sound effects using the Web Audio API.
All gameplay logic must work locally in the browser.
No placeholder buttons or fake interactions.
No unfinished features.
The game must work by opening the HTML file in a modern desktop browser.
## 1. GAME WORLD
Create a colorful, detailed top-down open-world city.
Include:
- Multiple city blocks.
- Roads with lane markings.
- Intersections and traffic lights.
- Sidewalks and pedestrian crossings.
- Buildings with different architectural designs.
- Parks, trees and street lamps.
- Shops, garages and gas stations.
- Moving cars and walking pedestrians.
- Decorative environmental details.
The city should feel alive rather than like an empty grid.
Use procedural drawing to create the environment.
The map must be larger than the visible screen, allowing the player to explore different neighborhoods.
## 2. PLAYER CHARACTER
Create a recognizable animated player character.
Features:
- Smooth eight-direction movement.
- Walking and running animations.
- Idle animation.
- Collision with buildings and obstacles.
- Camera follows the player.
- Character faces the direction of movement.
- Sprint functionality.
- Health system.
The player should never move through solid buildings.
## 3. VEHICLE SYSTEM
Allow players to enter and exit vehicles.
Include:
- At least 4 different vehicle types.
- Enter vehicle using E.
- Exit vehicle using E.
- Acceleration and braking.
- Steering and turning.
- Different vehicle speeds.
- Collision detection.
- Vehicle damage.
- Vehicle-specific movement physics.
Cars should look and behave differently from each other.
## 4. INTERACTIVE CITY
Make the city feel alive.
Include:
- NPC pedestrians with basic walking behavior.
- AI traffic following roads.
- Cars stopping at intersections.
- Traffic lights changing automatically.
- Buildings with recognizable entrances.
- Collectible cash scattered around the map.
- Interactive locations.
- A working minimap showing player position.
NPCs and traffic should respond naturally to the player's presence where possible.
## 5. MISSIONS AND OBJECTIVES
Create at least 5 playable missions.
Examples:
1. Collect 5 cash packages.
2. Reach a destination before the timer runs out.
3. Drive a vehicle to a marked garage.
4. Escape a pursuing vehicle.
5. Complete a city exploration challenge.
Each mission must have:
- A clear objective.
- An on-screen mission description.
- A progress indicator.
- A completion notification.
- A reward system.
Do not make missions automatically complete. The player must actually perform the required actions.
## 6. WANTED SYSTEM
Implement a basic wanted-level mechanic.
Wanted level from 0 to 5 stars.
Certain actions increase wanted level.
Police vehicles spawn when wanted.
Police pursue the player.
Losing police reduces wanted level.
Wanted level is displayed on screen.
## 7. GAMEPLAY UI
Design a polished, modern game interface.
Include:
- Main menu.
- Start game button.
- Pause menu.
- Resume button.
- Restart button.
- Player health bar.
- Cash counter.
- Wanted stars.
- Mission tracker.
- Minimap.
- Vehicle speed indicator.
- Settings panel.
The UI should feel like a finished indie game, not a basic programming demo.
## 8. VISUAL DESIGN
Art direction:
- Colorful, stylized 2D graphics.
- Detailed top-down city environment.
- Smooth animations.
- Beautiful lighting effects.
- Shadows under vehicles and characters.
- Subtle environmental animations.
- Professional HUD.
- Consistent visual design.
Avoid childish visuals and crude geometric placeholders.
Use a cohesive color palette and polished game presentation.
## 9. SOUND EFFECTS
Use the Web Audio API to generate original sound effects.
Include:
- Car engine sounds.
- Acceleration sounds.
- Braking sounds.
- Collision sounds.
- Cash collection sound.
- Mission completion sound.
- Button interaction sounds.
- Police sirens.
Add an audio toggle in settings.
Initialize audio only after user interaction with the game.
## 10. CONTROLS
Keyboard controls:
WASD / Arrow Keys: Move.
Shift: Sprint.
E: Enter or exit vehicle.
Space: Handbrake.
M: Toggle minimap.
Escape: Pause.
R: Restart.
Show a controls guide in the game menu.
## 11. GAME ENGINE AND PERFORMANCE
Use requestAnimationFrame.
Separate game updates from rendering.
Use delta time for consistent movement.
Implement camera tracking.
Implement map boundaries.
Optimize rendering for larger maps.
Avoid unnecessary object creation every frame.
Ensure collisions are stable.
Handle window resizing.
Support fullscreen mode.
Avoid memory leaks.
## 12. FINAL QUALITY CHECK
Before finishing:
- Verify that the game starts.
- Verify all keyboard controls.
- Verify vehicle entry and exit.
- Verify collision detection.
- Verify NPC movement.
- Verify traffic movement.
- Verify missions and rewards.
- Verify wanted-level behavior.
- Verify audio controls.
- Verify pause and restart.
- Verify there are no JavaScript errors.
Do not claim a feature works if it has not been implemented.
## FINAL OUTPUT RULE
Return the complete, runnable HTML document.
Do not explain your approach.
Do not provide multiple files.
Do not omit code.
Do not use pseudocode.
Do not use external dependencies.
Build the best playable mini open-world city game you can within these constraints. អានបន្ថែម
សង្ខេប
Emaan (@emaann28 លើ X) បានសរសេរ prompt វែងមួយដើម្បីបង្កើត game បែប top-down ក្នុងក្រុង។ Prompt ហ្នឹងគឺសុំឲ្យបង្កើត file HTML តែមួយ ដោយមិនប្រើរូបភាព file សំឡេង ឬ library ផ្សេងៗទេ។ Game ហ្នឹងត្រូវគូរអ្វីៗគ្រប់យ៉ាងក្នុង Canvas 2D ហើយបង្កើតសំឡេងដោយប្រើ Web Audio API។ ក្នុងនោះមានបែងចែកជា 12 ផ្នែក៖ ទីក្រុង, តួអង្គ, ឡាន, ចរាចរណ៍, mission ចំនួន 5, កម្រិតផ្កាយ (wanted stars), menu, រូបរាង, សំឡេង, ការបញ្ជា (controls), game engine និងការត្រួតពិនិត្យចុងក្រោយ។
ដំបូង Emaan បានយក prompt ហ្នឹងទៅសាកជាមួយ ChatGPT version free។ បន្ទាប់មក Emaan ក៏យក prompt ដដែលហ្នឹងទៅសាកជាមួយ Claude Sonnet 5.5។ Emaan ប្រាប់ថាលើកនេះតួអង្គនៅលើ screen ជានិច្ច ដើរលេងក្នុងក្រុងបាន ហើយអាចឡើងជិះឡានបានទៀត។ ក្នុង video រយៈពេល 87 វិនាទី បង្ហាញពី game ដែល Claude បង្កើត៖ មានប្លុកក្រុងដែលមានហាងដែលមានដាក់ឈ្មោះ, មានភ្លើងស្តុប, ឡានបើកចុះឡើង, មាន minimap និងមាន mission កំណត់ម៉ោងទៀតផង។
សម្រាប់កម្ពុជា
សិស្សៗនៅស្រុកខ្មែរច្រើនណាស់ដែលចង់ធ្វើ game តែអត់ចេះប្រើ game engine ឬអត់មានលុយជួលគេឌីហ្សាញ។ គ្រាន់តែប្រើ prompt ច្បាស់លាស់មួយ គឺអាចបាន game មួយដែលលេងលើ browser បានបាត់។ Prompt នេះក៏ជាគំរូដ៏ល្អមួយដែរ ព្រោះវាបំបែកការងារធំៗទៅជាផ្នែកតូចៗ ហើយមានទាំងបញ្ជីសម្រាប់ check ទៀត។
កំណត់ចំណាំ
កំណត់សម្គាល់
Post by Emaan (@emaann28 on X), 22 Nov 2026, read via the X API on 2026-11-24. The prompt is quoted verbatim from Emaan's own reply in the thread of the earlier ChatGPT post (https://x.com/emaann28/status/2124552844980445224). The prompt says 'inspired by classic GTA-style top-down games', but the city, the cars and the art are all drawn by code; there are no characters or assets from that game. The post had few likes on the check day. The hero clip is from the creator's own video. Title, summary and why are in our words.
ប្រភព
បើកប្រភពដើម។
https://x.com/emaann28/status/2124449310049730649 (បើកផ្ទាំងថ្មី)
កំណត់សម្គាល់ពីប្រយោគបញ្ជា
ទុក prompt ជាភាសាអង់គ្លេសដដែល។ ប្រើ AI model ណាដែលចេះសរសេរ code វែងៗ។ បើក file HTML ក្នុង browser លើកុំព្យូទ័រ។ បើមានកន្លែងណាដើរមិនស្រួល គ្រាន់តែ copy error ហ្នឹងដាក់ចូលក្នុង chat វិញទៅ។ អ្នកអាចដូរឈ្មោះក្រុង ឈ្មោះហាង ឬ mission តាមចិត្តចង់បាន។
ប្រភេទដំបូងលើករណីមួយ គឺជាគោលបំណងចម្បង។ ប្រភេទបន្ទាប់ គឺជាស្លាកបន្ទាប់បន្សំ។