Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

Conversion of an old C++ OpenGL GLUT demo to JavaScript/WebGL
https://github.com/lostjared/masterpiece3d.javascript

javascript-demo opengl-demo puzzle-game webgl

Last synced: about 1 month ago
JSON representation

Conversion of an old C++ OpenGL GLUT demo to JavaScript/WebGL

Awesome Lists containing this project

README

        

# MasterPiece3D.JavaScript

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

![screenshot2](https://github.com/lostjared/MasterPiece3D.JavaScript/blob/main/mp3d_per.jpg)

Conversion of an old C++ OpenGL GLUT demo to JavaScript/WebGL
This is a WebGL-based block game where the player can control falling
blocks, rotate their colors, and attempt to match colors in a grid.

The original project source code can be found here:
https://github.com/lostjared/Old.Learning.Projects/tree/master/mp3d_win32_vs.net2003

## Features

- Control falling blocks using keyboard inputs.
- Rotate block colors using the Up arrow key.
- Move blocks left, right, and down using arrow keys.
- New blocks are released when last block it set to the grid.
- Basic game mechanics implemented with WebGL for rendering.

## Controls

- **Arrow Keys**: Move the block left, right, and down.
- **Up Arrow Key**: Rotate the colors
- **H / h**: Reset rotation angles.
- **D / d**: Set specific rotation angle for the block.
- **V / v**: Set different specific rotation angles.

### Prerequisites

- Web browser with WebGL support (most modern browsers).
- Web Server (can use Python)

To View this locally run in this directory

```bash
python3 -m http.server 3000
```
then point your web browser to localhost:3000

## Project Structure

- `index.html`: The main HTML file.
- `main.js`: The main JavaScript file containing game logic and WebGL
rendering.
- `gl-matrix.js`: A library for matrix operations (used for
transformations in WebGL).