Skip to content

makaveli2P/land-or-water

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Land-or-Water

I came across this cool looking repository and had an idea to create my own version.

How it Works

  1. Open the index.html file in a web browser.
  2. The game will start automatically, with two balls (green for land and blue for water) bouncing around the globe.
  3. 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).
  4. 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).
  5. The land and water scores at the bottom of the screen indicate the current area captured by each territory.
  6. The page background color will change dynamically based on which territory (land or water) is currently dominating.
  7. The game continues indefinitely until you decide to stop or refresh the page.
gameplay

How to Customize

You can easily customize various aspects of the game by modifying the JavaScript code:

  1. Color Palette: Adjust the color shades for land and water tiles by modifying the colorPalette object in the code.
  2. Square Size: Change the size of the tiles by modifying the SQUARE_SIZE constant.
  3. Ball Speed: Adjust the minimum and maximum ball speeds by modifying the MIN_SPEED and MAX_SPEED constants.
  4. Ball Colors: Change the colors of the land and water balls by modifying the LAND_BALL_COLOR and WATER_BALL_COLOR constants.

Some maps!