Lua remake of an Amiga cracktro

Recently, I wanted to test the Plus wrapper of Harfang on a simple project, and I found that I could try to remake an ancient Amiga cracktro I used to enjoy back in the days.

YouTube Preview Image

Starfield!
The starfield is a simple list of 3D points on which a vector is applied each frame, transformed from 3D to 2D and displayed using 2D sprites. The 3D to 2D projection works the usual way :

x2d = (a.x * zoom) / a.z
y2d = (a.y * zoom) / a.z

There’s room for an optimization, as the whole list of sprites could be drawn as a unique batch. If more performance was needed, for several thousands of stars for example, DrawSpriteAuto() would really work faster.

Music!
The venerable ProTracker module, available on the Exotica archives, was converted to the XM format and replayed easily in Harfang, using the following instruction :

al:Stream("assets/unit5.xm")

Let’s Scroll!
The scroll text, finally, was made easy to render thanks to the Plus wrapper, by blitting each glyph to the screen. The original font was grabbed from the original cracktro using a memory snapshot from the WinUAE emulator.

Each glyph is then drawn, using :

Blit2D()

This remake is not 100% accurate as the scope of this project was more focused on using the Plus wrapper than being in competition with the most excellent Flashtro project.

Here is the Win64 release :
http://fra.planet-d.net/prods/Unit-A-Interceptor-Win64.zip

Here is the source code on Github :
https://github.com/astrofra/harfang-lua-experiments/tree/master/unit-a-interceptor-remake/src

Leave a Reply

Your email address will not be published. Required fields are marked *