Z+ - Board Model

Posted on November 5, 2011 by Jack Kelly
Tags: zplus, coding

Before I start hacking away, I really need to think about what the data model for an individual board is going to look like. In ZZT, each world consisted of multiple 60x25 boards with links between them. I intend to relax the 60x25 restriction, allowing boards of arbitrary (but fixed) size.

I will probably store the contents of each board as an array, for the following reasons:

The next question to answer: what goes into each board cell? My first though was to have a background of arbitrary character and foreground/background colour, with a possible object on top. That hits a wall when passages are considered.

For those who don’t remember, a ZZT passage is an object, that when touched, transports the player to a destination board (either to a passage of the same colour, if it exists, or to the location of the player object on that board). I want to keep multiplayer in the back of my mind as I write Z+, so a player cannot instantly disappear into a passage if it’s occupied by someone else. Therefore, I will replace the inert background by second layer of objects, to represent things like floor spikes, passages, lava and so on.

This means that each board has two layers of objects: foreground and background. I am strongly against adding more layers - simplicity is a design goal!. So long as it is cheap to create and store inert objects (that is, objects without code), I see no problem with this approach. Solid walls were going to be objects without code anyway.

Previous Post
All Posts | RSS | Atom
Next Post
Copyright © 2023 Jack Kelly
Site generated by Hakyll (source)