/graphics

Primary LanguageJavaScript

Graphics

We were just reminiscing about staying up late reading "tutors" and creating awesome effects in QB45.

This is an attempt at recreating some of the long lost BAS files.

No longer can we just call interrupt 10h and poke at the 64000 bytes from a000h, and DOSBox is a bit much for kids these days. But everyone has a browser, and JavaScript is alright. So I've created a library of functions that allow us to setup a 320x200 canvas with 256 color palette and create all the classic effects.

The code is ES6 that runs directly in the browser so no complicated compiling or transpiling required. I've tried to keep the code simple, just data and procedures. There are JSDoc comments to give you and your text editor hints (may I suggest Visual Studio Code).

Anyway, I'm having a lot of fun rereading all the tutors and recreating these effects.

Star Field Lambert Cube Fire Conway's Game of Life Mandelbrot Set Ray Casting Fibonacci Sphere Texture Cube

Run Online

Run Locally

  1. Clone or download and unzip the repository
  2. Install the Web Server for Chrome Extension
  3. Use the Web Server to serve the local copy of the repo
  4. Navigate to the URL provided (something like http://127.0.0.1:8887)

Inspiration

You'll probably need to use the wayback machine to find these sites:

Project Structure

There is a folder for each demo effect in some kind of chrono order. Each demo has a html file (which is exactly the same) and a js file that contains all the fun code.

Any code that is reusable ends up in the lib folder.