This website uses cookies.Before continuing to use our website, you agree and accept Privacy policy.Accept

Simple Golf made with AI


Drag to set angle, then release a ball.

PC - Smartphone



DESCRIPTION

It’s a so-called putter-style game. Avoid obstacles and aim for the hole!

HOW TO MAKE/PROMPT

Created using Claude sonnet. The prompt was as follows:
Make a golf HTML game

#structure
- html,js,css in file
- 512x512 canvas max-width:100%

#Script
##Variable


##init
- The background is green.
- A black wall covers 15% of the screen's width and height from all sides.
- The hole is located 20% from the left and 20% from the top of the screen.
- Your ball is positioned 30% from the right and 30% from the bottom of the screen.
- An obstacle, measuring 10% by 10%, is placed at 40% from the left and 40% from the top.
- Another obstacle, also 10% by 10%, is placed at 50% from the left and 55% from the top.
- A reset button is located at the bottom of the screen.

##loop
- When you drag your ball, a white line indicating direction and power appears.
- Upon release, the ball will move according to the indicated direction and power. If it hits a wall, it will bounce off.
- The game is cleared when your ball goes into the hole in the top left corner.

What if there is an error?




<< menu

On-site search