ហ្គេមពស់ Snake បែប 2.5D ស្អាតកប់ក្នុង Three.js ចេញពី prompt វែងមួយជាមួយ Gemini 4 Carbon
ប្រភព: @SimonasLTU1 (បើកផ្ទាំងថ្មី)

ហ្គេមពស់ Snake បែប 2.5D ស្អាតកប់ក្នុង Three.js ចេញពី prompt វែងមួយជាមួយ Gemini 4 Carbon

Gemini សង់ហ្គេមពស់ដែលមើលល្អក្នុងឯកសារ HTML តែមួយ មានពន្លឺ ជម្រៅ និងពស់រលូន។

របៀបប្រើ

  1. ចម្លង prompt។
  2. បិទភ្ជាប់ prompt ចូលក្នុង Gemini។
  3. បើកឯកសារ HTML ក្នុងកម្មវិធីរុករក។
  4. ពិនិត្យចលនា អាហារ និងពិន្ទុ។

FORWHAT

ប្រយោគបញ្ជាដើម · អង់គ្លេស

Create a polished, visually impressive 2.5D Snake game using Three.js.

The entire game must be contained in a single standalone HTML file with all CSS and JavaScript included inside it.

I do not want this to feel like a basic Snake clone or a technical demo. The goal is to take the classic Snake concept and turn it into a stylish, modern, highly animated visual experience that still feels immediately familiar and fun to play.

Use a 2.5D perspective rather than a completely flat top-down view. The gameplay should remain easy to read like classic Snake, but the world should have depth, perspective, lighting, shadows, layered geometry, and subtle camera movement.

The snake itself should feel alive.

Give it:

- smooth movement between grid positions
- fluid body-following animation
- subtle head movement
- animated turns
- satisfying growth when collecting items
- expressive death animation
- soft shadows
- polished materials
- visual feedback when accelerating or collecting something

Avoid making the snake look like a simple chain of default cubes.

Give it a cohesive stylized design with a recognizable head and smoothly connected body segments.

The world should be visually interesting as well.

Create a compact arena with a strong art direction rather than an empty grid floating in space.

You have creative freedom over the exact visual style, but make it feel polished, intentional, and memorable.

Use elements such as:

- layered floor geometry
- subtle environmental animation
- atmospheric particles
- dynamic lighting
- shadows
- reflections where appropriate
- ambient background details
- soft fog or depth effects
- tasteful post-processing-style visuals
- animated borders or arena elements

The scene should have a strong sense of depth without making the gameplay difficult to read.

GAMEPLAY

Keep the core Snake rules recognizable:

- the snake moves continuously
- the player changes direction
- collecting food makes the snake longer
- hitting the snake's own body ends the run
- hitting dangerous boundaries or obstacles should matter
- score increases as the player collects items

Controls should feel immediate and responsive.

Support:

- Arrow keys
- WASD

Prevent impossible instant 180-degree turns.

The game should gradually become more difficult as the score increases.

Difficulty can increase through:

- slightly higher speed
- environmental hazards
- obstacles
- more complex arena layouts
- moving objects
- temporary modifiers

Do not make difficulty increases unfair or random.

COLLECTIBLES

Do not use a boring static red cube as food.

Create visually satisfying collectible objects with:

- animation
- glow or subtle particles
- rotation or floating motion
- collection effects
- sound feedback if audio is included

Normal collectibles should be immediately recognizable.

You may also add occasional special collectibles, such as:

- bonus score item
- temporary slow-motion item
- temporary speed boost
- score multiplier
- rare collectible worth significantly more points

Keep special items relatively rare.

VISUAL FEEDBACK

Every important gameplay event should feel satisfying.

When the player collects an item:

- create a small particle burst
- animate the score
- briefly emphasize the snake head
- add subtle camera or lighting feedback

When the snake grows:

- make the growth visually smooth
- do not instantly spawn a disconnected-looking segment

When the player reaches a score milestone:

- provide subtle but noticeable visual feedback
- avoid interrupting gameplay with a modal

When the player dies:

- briefly slow the scene down
- create a polished death animation
- visually communicate the collision
- then show the end-of-run interface

CAMERA

Use a cinematic 2.5D camera angle.

The camera should subtly follow the action and react to movement, but it must not make the player lose orientation.

Do not allow free camera orbit during gameplay.

Use small amounts of:

- camera easing
- subtle zoom
- gentle rotation
- impact shake

Keep these effects restrained.

UI

Keep the HUD minimal and visually integrated with the game.

Show:

- current score
- high score
- current multiplier if relevant
- current speed or level if useful

Do not cover the scene with large panels.

Use clean typography and subtle animations.

START SCREEN

Create a polished start screen that visually matches the game.

Include:

- game title
- short instruction text
- Play button
- high score if one exists

Avoid a generic default HTML button floating in the middle of the page.

GAME OVER SCREEN

After death, show:

- final score
- high score
- restart option
- one small performance statistic, such as longest snake length or items collected

The restart should be immediate.

ANIMATION QUALITY

Animation quality is one of the most important parts of this task.

Use smooth interpolation instead of abrupt movement wherever possible.

Pay attention to:

- snake movement
- turning
- camera movement
- collectible animation
- particles
- UI transitions
- arena animation
- lighting changes

The game should feel smooth and polished even though its rules are simple.

AUDIO

If practical, include lightweight generated audio using the Web Audio API.

Possible sounds:

- item collection
- special item collection
- milestone
- death
- UI interaction

Do not rely on external audio files.

Keep sounds subtle and satisfying rather than loud or arcade-like.

PERFORMANCE

Keep the game efficient.

Avoid excessive geometry or particle counts.

The game should remain smooth on a normal modern desktop browser.

Do not sacrifice visual quality unnecessarily, but avoid wasteful rendering.

IMPORTANT

Do not stop once the game technically works.

Before considering it finished, inspect the result critically.

If anything looks like:

- placeholder geometry
- default Three.js materials
- generic HTML UI
- empty background
- stiff animation
- disconnected snake segments
- boring collectibles
- unfinished lighting
- obvious prototype visuals

improve it.

The final result should look like a small polished indie game, not a tutorial project.

Prioritize:

1. visual quality
2. smooth animation
3. responsive controls
4. satisfying feedback
5. cohesive art direction
6. readable gameplay
7. polish

The core game may be simple, but the presentation should have a strong wow factor.
បើកក្នុង ChatGPT (បើកផ្ទាំងថ្មី) បើកក្នុង Claude (បើកផ្ទាំងថ្មី)
អានបន្ថែម

សង្ខេប

Simonas (@SimonasLTU1 លើ X) បានផុសហ្គេម Snake បែប 2.5D ដែល Gemini 4 Carbon បង្កើតក្នុងពេលប្រហែល 13 minutes ហើយគាត់ក៏បានចែករំលែក prompt ពេញរបស់គាត់ក្នុង reply ដែរ។ អ្វីៗទាំងអស់ដើរចេញពី file HTML តែមួយជាមួយ Three.js មានទាំងទីលានដែលមានពន្លឺ ស្រមោល និងជម្រៅ ចំណែកតួពស់វិញមើលទៅរលូនមានក្បាលត្រឹមត្រូវ មានចំណីភ្លឺៗ និងមានកម្ទេចពន្លឺពេលស៊ីចំណីទៀត។

Prompt ហ្នឹងសរសេរដូចជា design brief អញ្ចឹង។ វារក្សាច្បាប់ដើម (ស៊ីដើម្បីធំ ងាប់ពេលបុកកន្ទុយខ្លួនឯង ហាមបត់ត្រឡប់ក្រោយភ្លាមៗ ប្រើ arrow keys ឬ WASD) ហើយបន្ទាប់មកសុំឱ្យមាន animation រលូន កាមេរ៉ាដេញតាមតិចៗ សំឡេងប្រើ Web Audio API មាន screen ពេលចាប់ផ្តើម និងពេល game-over ហើយនិងកម្រិតពិបាកដែលសមរម្យ។ ចុងក្រោយ វាប្រាប់ model ឱ្យពិនិត្យមើលលទ្ធផលខ្លួនឯងឡើងវិញ ហើយកែរាល់កន្លែងណាដែលមើលទៅដូចជាកន្លែងទុកចោល ឬដូចជា project មេរៀនធម្មតា។

សម្រាប់កម្ពុជា

ស្ទើរតែគ្រប់គ្នានៅស្រុកខ្មែរស្គាល់ហ្គេម Snake តាំងពីសម័យទូរស័ព្ទ Nokia ចាស់ៗ។ សិស្សដែលរៀនសរសេរ code អាចប្រើ prompt នេះជា checklist ដើម្បីដឹងថាត្រូវធ្វើម៉េចឱ្យហ្គេមធម្មតាមួយមើលទៅដូចហ្គេមសម្រេច រួចយក structure ហ្នឹងទៅប្រើជាមួយហ្គេមតូចៗផ្សេងទៀតបាន។

កំណត់ចំណាំ

កំណត់សម្គាល់

Post by Simonas (@SimonasLTU1 on X), 10 Nov 2026: https://x.com/SimonasLTU1/status/2120192174239146417; the full prompt is in his reply https://x.com/SimonasLTU1/status/2120192205587358015 (both checked via the X API on 2026-11-11). The prompt is quoted verbatim. Gemini 4 Carbon and the 13 minutes are as stated in his post. Title, summary and why are in our words.

ប្រភព

បើកប្រភពដើម។

https://x.com/SimonasLTU1/status/2120192174239146417 (បើកផ្ទាំងថ្មី)

ពិនិត្យថ្ងៃ 2026-11-11។

កំណត់សម្គាល់ពីប្រយោគបញ្ជា

អ្នកអាចសុំឱ្យមានអក្សរខ្មែរលើ screen ចាប់ផ្តើម និង game-over បាន។ ទុក prompt ជាភាសា English ដដែល។ បើអ្នកមិនមាន Gemini 4 Carbon ទេ សាកប្រើ prompt ដដែលហ្នឹងជាមួយ model ផ្សេងដែលចេះសរសេរ code ក៏បាន។

ប្រភេទដំបូងលើករណីមួយ គឺជាគោលបំណងចម្បង។ ប្រភេទបន្ទាប់ គឺជាស្លាកបន្ទាប់បន្សំ។

ស្វែងរកក្នុងបណ្ដុំ