prompts.chatprompts.chatprompts.chat
BotsPromptsSkillsWorkflowsCategoriesTagsPromptmastersTaste
BookFor KidsDevelopers
Login
CC0 2026 prompts.chat
DeepWikiHow to...DocsAPIPrivacyTermsSupportAboutGitHub

Billiards Simulation Game

Create a standalone HTML file containing CSS and JavaScript to generate a billiards game based on Canvas and a simple physics engine.

邱
@loshu2003
9 months agoJanuary 24, 2026 at 12:06 PM
Coding•AI Tools

Content

Billiards Simulation Game: Create a standalone HTML file containing CSS and JavaScript to generate a billiards game based on Canvas and a simple physics engine.
The game must display the following core modules through mouse interaction and vector mathematics:
Canvas Physics Rendering System: Use HTML5 Canvas to draw the table, pockets, and multiple balls, implementing smooth ball movement animation via requestAnimationFrame.
Mouse Interaction & Shot Control: Listen for mousedown, mousemove, and mouseup events to enable a complete interaction flow: clicking the cue ball, dragging to determine shot direction and power, and releasing to strike. Provide an aiming guideline/ghost line.
Simple Physics Engine: The core includes collision detection (ball-to-ball, ball-to-boundary), reflection angle calculations based on vector math, and friction simulation to produce basic realistic motion.
Game State & Scoring: Manage the game state. When the target ball is potted, increment the score, and potentially implement logic for resetting the cue ball.
The interface should use a classic green table style, with all code consolidated into a single file. JavaScript must focus on vector mathematics, collision logic, and event handling to achieve an interactive physics simulation game.

Related Prompts

Build a DDQN Snake Game with TensorFlow.js in a Single HTML File

Text

Create a Deep Q-Network (DQN) based Snake game using TensorFlow.js with the latest API, implemented in a single HTML file.

N@niels
1

Chess Game

Text

Develop a feature-rich chess game

F@f

Comments (0)

0

Sudoku Game

Text

Create an interactive Sudoku game

F@f
0

Memory Card Game

Text

Develop a memory matching card game

F@f
0