I came across this cool looking repository and had an idea to create my own version.
- Open the
index.html
file in a web browser. - The game will start automatically, with two balls (green for land and blue for water) bouncing around the globe.
- The globe is divided into tiles, with one half initially representing land (shades of green and brown) and the other half representing water (shades of blue).
- When a ball collides with a tile of the opposite territory, the tile's color changes to the ball's color (either a land or water shade).
- The land and water scores at the bottom of the screen indicate the current area captured by each territory.
- The page background color will change dynamically based on which territory (land or water) is currently dominating.
- The game continues indefinitely until you decide to stop or refresh the page.
You can easily customize various aspects of the game by modifying the JavaScript code:
- Color Palette: Adjust the color shades for land and water tiles by modifying the
colorPalette
object in the code. - Square Size: Change the size of the tiles by modifying the
SQUARE_SIZE
constant. - Ball Speed: Adjust the minimum and maximum ball speeds by modifying the
MIN_SPEED
andMAX_SPEED
constants. - Ball Colors: Change the colors of the land and water balls by modifying the
LAND_BALL_COLOR
andWATER_BALL_COLOR
constants.