java maze - Technical
java maze targets the Java 1.1 platform. Rather than use the AWT drawing calls (a failed concept from the early days of java maze), the MemoryImageSource class was used to simulate a 8-bit palletised framebuffer.
It uses a raycasting method which was painstakingly developed from scratch on paper. This method uses simple maths to check the ray where it intersects block boundaries in the map. Although no other raycaster source codes were used as a reference to develop java maze, I find it unlikely that there is anything new or innovative about this approach. I deliberately omit detailed information on basic raycasting techniques to avoid diluting the excellent body of information already available on this subject.
Textures are stored as 64x64 .gif files and share a common 256-colour palette. The engine allows for each block within the map to be assigned a light-level - this is facilitated through the use of a colour lookup table (CLUT), a two-dimensional array computed at runtime that stores the index of the closest colour for sixty-four light levels of each colour in the palette.
The engine also allows for floor and ceiling textures. Each block in the map is assigned a texture, and the floors and ceilings are drawn in horizontal spans. Objects are given screen coordinates by simple 3D maths, and drawn in vertical spans using a z-buffer prepared during the raycasting process. One index of the palette is marked as transparent, allowing non-solid objects to be drawn.