Tim Seyfarth had a specific question about adding a Z-axis to a floorplan. Immidiately I was thinking about the Isometric games like Diablo and I thought it would be a nice thing to try it out in Realbasic/Xojo. However, it looked like it was not that easy to implement as it seems. A lot of math is needed to create an engine like this. As my time is limited, I decided to spend some evenings translating an existing engine into Realbasic/Xojo. I have chosen the μIso (μIsometric Engine: A Java Isometric Engine) engine. The original code can be found here. All credit for the think work goes to Luis Henrique Oliveira Rios. Visit his page for some explanation.
μIso has some flaws I noticed (sometimes a ‘strange’ hole is visible in the montains or the mouse pointer loses track) but as you have the source code you can try to figure it out for yourself.
The speed in Realbasic/Xojo is also very slow (I get 7 frames per second, while the original java code got over 30 fps), but don’t let this discourage you to take a look on how it works. I don’t see this as an engine to create games with, but rather a tool to generate static pictures (like a floorplan).
You can scroll through the demo with the cursor keys (the minotaur does not move as I did not include the pathfinding algorithm). You can move the mouse to highlight a tile.
The program consists of two main folders:
This contains the real engine. Except for bug fixing, you should not need to make any changes to these classes.
This is a demo how you use the engine. All classes here are subclasses of the engine classes.
The full source code can be downloaded here UISO2.5D.zip
Some notes about the code:
1. change the path to the sprites (SpritePath) !!!!!!!!!!!!
2. if working with PRE Xojo, download the PNGutilities plugin (http://gorgeousapps.com/PNGUtilitiesPlugin.zip) and change in LoadABImage (ABGlobal):
for RB 2007:
dim img as new ABImage(PNGu.OpenAsPictureWithMask(f))
dim img as new ABImage(picture.Open(f))
Have fun programming and cheers for now!