An open API service indexing awesome lists of open source software.

https://github.com/lostjared/masterball.javascript

Conversion on an old C++ DirectX Game Demo to HTML5/JavaScript
https://github.com/lostjared/masterball.javascript

Last synced: 10 months ago
JSON representation

Conversion on an old C++ DirectX Game Demo to HTML5/JavaScript

Awesome Lists containing this project

README

          

# Master Ball

![screenshot](https://github.com/lostjared/MasterBall.JavaScript/blob/main/screenshot.jpg)

Master Ball is a classic breakout-style game implemented using HTML5 and
JavaScript. The game features a ball that bounces off walls and a paddle that the player controls to prevent the ball from falling off the screen. The objective is to clear all the blocks on the screen by hitting them with the ball.

## Gameplay

- Control the paddle using the left and right arrow keys.
- The ball will bounce off the walls, paddle, and blocks.
- When the ball hits a block, the block is destroyed and the player scores points.
- If the ball falls off the bottom of the screen, the player loses a life.
- The game ends when the player runs out of lives.

## Features

- Smooth paddle movement using `requestAnimationFrame`.
- Randomly generated blocks with different colors.
- Score tracking and level progression.
- Game over alert and reset functionality.

## Installation

To play the game, simply open the `index.html` file in a web browser.

## Files

- `index.html`: The main HTML file containing the game.
- `main.js`: The JavaScript file containing the game logic.

## How to Play

1. Clone the repository or download the files.
2. Open `index.html` in your web browser.
3. Use the left and right arrow keys to move the paddle.
4. Clear all the blocks to advance to the next level.
5. Avoid letting the ball fall off the bottom of the screen.