The MSX Knightmare video game entirely written in MMBasic.
This version is still in development!
Knightmare is a 1986 vertically scrolling shooter video game developed and published by Konami for the MSX home computer.
For more about the video game, Knightmare on Wikipedia
MMBasic is a free, fast and open BASIC interpreter for microcontrollers.
It includes floating point numbers, extensive string handling, multi-dimensional arrays, and structured programming features like do loops, multiline if statements, user-defined subroutines, and functions.
See more at the MMBasic home page
The Windows/DOS version of MMBasic was created to make it easy to evaluate MMBasic. It is a single executable that does not need installation, just double-click on the executable and MMBasic will run in a DOS window on Windows (including Windows 10). It also runs in Linux using Wine.
The executable and documentation can be downloaded from https://www.thebackshed.com/forum/uploads/matherp/2023-12-24_033644_MMBasic.zip.
After downloading the source code from this repository and executing the MMBasic, you will need to access the directory where the Knightmare is located using the command chdir "dir/for/the/game"
. You can also use the command files
to list the directory content.
To run the video game use the command run "km.bas"
Knightmare has a total of 8 different stages, each with its map. The maps were designed using the Tiled map editor, a powerful open-source tool for creating video game maps.
I created a nodejs script that converts the exported json map to the binary format used by the game engine.
The binary format is very simple:
2 Bytes per tile
0000 0000 0000 0000
| | ||-------> 7 bits: Tile Id
| | |--------> 1 bit : Solid bit
| |---------------> 5 bits: Objects, enemies, power-ups
|------------------> 3 bits: Object properties