18 Holes - Educational Golf Math Game

Seele01-Flash
By
18 Holes is a charming educational golf game that combines fun golfing gameplay with math practice. Players must collect stars, navigate obstacles, and solve math problems between levels to progress through this physics-based platformer.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "18 Holes: Math & Golf". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: A "Cute Low-Poly" aesthetic with a 2.5D side-scrolling perspective. Use an **Orthographic Camera** to maintain a flat, platformer-like view while retaining 3D depth. * **Color Palette**: Bright, educational colors. Sky blue background (`#87CEEB`), vibrant green grass (`#7CFC00`) on top of brown soil blocks (`#8B4513`), and a bright white ball. * **Environment Construction**: The level should be built of grid-based blocks (voxel-style or tiled) forming a platformer course with gaps, slopes, and vertical walls. * **Key Objects**: * **Player**: A simple white sphere (golf ball). * **Goal**: A cylindrical hole with a flagstick and a red flag that animates (waves) slightly. * **Collectibles**: Golden 3D Stars rotating in the air. * **Performance**: Use `BoxGeometry` for terrain and merge geometries where possible. Use simple Lambert materials for lighting efficiency on mobile devices. Shadows should be soft or baked if possible (otherwise, simple directional light shadows). ### 2. Audio Requirements * **BGM**: A relaxing, loopable "Lobby/Elevator" style track. Light jazz or soft synth-pop that aids concentration (educational vibe). * **Sound Effects (SFX)**: * **Aiming**: A stretching rubber-band sound that increases in pitch as drag intensity increases. * **Swing/Hit**: A crisp "Putt" or "Thwack" sound. * **Star Collection**: A high-pitched, positive generic "Ding" or chime. * **Hole-In**: A satisfying "Rattle" or "Clunk" of the ball hitting the cup. * **Math UI**: Soft "Pop" for clicking answers, "Buzzer" for wrong answers, "Cheer" for completing the quiz. ### 3. Gameplay Loop * **Phase 1: Math Quiz (Gatekeeper)**: * Before the level starts (or between holes), show a DOM-based UI overlay. * Generate simple random math problems (Addition/Subtraction/Multiplication). * **Requirement**: The player must answer 5 questions correctly to unlock the golf phase. * **Phase 2: Golfing**: * **Mechanic**: "Slingshot" physics. The player drags on the screen to pull back power and aims an angle. * **Trajectory Guide**: As described in the reference, render a **dotted green line** (using simple loop sprites or small spheres) showing the predicted path of the ball based on the current drag vector. * **Turn-Based**: The ball must come to a complete stop before the player can hit again. * **Scoring**: * Collect stars by touching them. * Count the number of strokes (hits). Limit the total strokes allowed (e.g., Par + 3). * **Win Condition**: The ball enters the hole (distance check < hole radius). * **Fail Condition**: The ball falls off the platform (y < -10) or the player runs out of strokes. ### 4. Mobile Controls & Interaction * **Control Scheme**: **Touch & Drag**. * Touch anywhere on the screen to initiate the aim. * Drag backward (opposite to target) to charge power. * Release to shoot. * **Visual Feedback**: * Draw an arrow helper or line from the ball indicating the launch direction. * Change the arrow color from Green (low power) to Red (max power). * **Responsiveness**: * Ensure `touch-action: none` is set on the canvas to prevent browser scrolling while playing. * UI buttons (for the Math section) must be large (min 44x44px) for easy tapping. * Support both Portrait and Landscape, but optimize the camera zoom to keep the ball and immediate obstacles in view. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

18 Holes is an innovative educational sports game that brilliantly combines golf gameplay with mathematics learning. Rated 4.1/5 by players, this cute and engaging game transforms math practice into an enjoyable gaming experience. The game features physics-based golf mechanics where players must strategically aim their shots to collect stars and reach the hole while overcoming various obstacles.

Core Features

Educational Gaming at Its Best

18 Holes stands out as an exceptional educational game that makes learning math fun and interactive. The game cleverly integrates math problems between golf levels, ensuring players practice their mathematical skills while enjoying entertaining gameplay.

Physics-Based Golf Mechanics

The game utilizes realistic physics simulation to create authentic golf ball movement. Players must consider angles, power, and trajectory when making their shots, adding a layer of strategic thinking to the gameplay experience.

Star Collection System

Each level challenges players to collect up to 3 stars while navigating to the golf hole. The star collection system adds replay value as players strive to achieve perfect scores on every level.

Progressive Difficulty

With carefully designed levels that increase in complexity, the game maintains engagement while gradually building both golf skills and mathematical abilities.

Cross-Platform Compatibility

Built with HTML5 technology, 18 Holes runs seamlessly on computers, tablets, and mobile devices without requiring downloads or installations.

Game Mechanics

Golf Gameplay

The core golf mechanics require players to: - Click, hold, and angle the directional line to aim shots - Control shot power by pulling back further for stronger hits - Use green guide dots to predict ball trajectory - Navigate around obstacles and terrain features - Complete levels within a limited number of shots

Educational Component

Between golf levels, players must: - Select their grade level for appropriate math difficulty - Choose specific math skills to practice - Answer 5 math problems correctly to unlock the next golf level - Progress through various mathematical concepts

Operation Guide

Getting Started

  1. Select Grade Level : Choose your appropriate grade for math problems
  2. Pick Math Skills : Select the specific mathematical area you want to practice
  3. Play Golf Levels : Navigate through golf challenges to earn the right to practice math
  4. Answer Questions : Solve 5 math problems correctly to unlock the next golf level

Golf Controls

  • Click and Hold : Press and hold the mouse button to aim your shot
  • Drag to Aim : Move the mouse to adjust the angle and power of your shot
  • Green Dots : Use these visual guides to predict your ball's path
  • Release to Shot : Let go of the mouse button to hit the ball

Winning Strategy

  • Plan your shots to collect all 3 stars in each level
  • Consider obstacle placement when choosing your trajectory
  • Use minimal shots to achieve higher scores
  • Practice math problems efficiently to return to golf gameplay quickly

Why Play 18 Holes

Perfect Educational Balance

18 Holes offers the ideal solution for students who need math practice but want to avoid study burnout. The game breaks up learning sessions with engaging golf gameplay, making education feel like entertainment.

Skill Development

Players develop multiple skills simultaneously: - Mathematical abilities through structured problem-solving - Strategic thinking via golf shot planning - Hand-eye coordination through precise aiming and timing - Physics understanding by observing ball trajectory and momentum

Family-Friendly Fun

With its cute art style and all-ages content rating, 18 Holes provides safe, educational entertainment for children while remaining engaging enough for adults to enjoy.

Accessible Learning

The game's mobile-friendly design means students can practice math and enjoy golf gameplay anywhere, making it perfect for both classroom use and home study sessions.

Frequently Asked Questions (FAQ)