"Spectrum Scroller"

an arcade game for Windows in a very early development state

Lately, I've been working on a simple arcade game called "Spectrum Scroller". Currently, it's really more of a tech demo.

Download the game HERE and extract the zip file. Use the "Spectrum Scroller.exe" binary to play.

The goal of the game in its current state is to destroy as many green-circle-things as possible. If you let the green thing get past your white orb thing, the game ends. If you shoot it, it explodes and makes a cool little effect. Move the mouse up and down and click to control the game. 

I soon plan to expand the game; I will add more levels (with different gameplay mechanics), music, and background effects. The title will probably change as well.

Technical Information

This project is made using QB64, a modern variant of Microsoft's QBASIC. This variant allows me to get mouse input, as well as use different resolutions and color-depths. QB64 also runs considerably fater than QBASIC ran in DOS.

The game makes extensive use of dithering in order to mix together colors in the background. If you look closely at the background, you will notice that the screen is divided into small 2x2 pixel squares. Each of these pixels is assigned to a different layer of the background, such as the red lines and the floor textures. This dithering means that the true useful background resolution is about 1/4 of the actual resolution, whereas the foreground uses the full 512x256 resolution.

Another neat thing about the background art in this game is that it is all generated with simple mathematical functions; no image files or 2d/3d image manipulation libraries were used. The entirety of the code which generates the background each frame is as follows:

    FOR x = 0 TO 511 STEP 2
        FOR y = 0 TO 255 STEP 2
            PSET (x, y), _RGB32(INT((ABS(x + i * y / 128) * speed MOD (y + 1)) / 16 + 8) * y / 8, 0, 0)
            PSET (x + 1, y), _RGB32(0, 0, INT((ABS(x + i * (y * 64 / 63) / 128) MOD (y + 1)) / 16 + 8) * y / 8)
            PSET (x, y + 1), _RGB32(0, INT((ABS(x + i * (y * 63 / 64) / 128) MOD (y + 1)) / 16 + 8) * y / 8, 0)
            PSET (x + 1, y + 1), _RGB32(y ^ 2 * (SIN(32 * (x - 256 - 5 * SIN(speed)) / (y + 32) + i / 5) - 2 / 3), score, score)
        NEXT
    NEXT

These independently-derived functions are the only thing creating the scrolling 3d effect of the background.