OpenBOR uses the Cartesian Coordinate System to describe locations on the display screen and in the game world. The actual behavior of an axis depends on whether it is being used to describe a static location, velocity, dimensions, and so on. Behaviors will also vary depending upon being on screen or in the game world.
OpenBOR uses the Cartesian Coordinate System to describe locations on the display screen and in the game world. The actual behavior of an axis depends on whether it is being used to describe a static location, velocity, dimensions, and so on. Behaviors will also vary depending upon being on screen or in the game world.
Contents
Game Field
The game field is the “world” – a virtual space stages and entities occupy during the game. This game field is a three dimensional space with very granular position and movement using floating point decimals. For most purposes, you don’t need to worry about that kind of precision, and in fact you can’t unless working with scripts. This is because almost all text commands work in whole pixels. Objects can (and often do) exist outside of stage boundaries. Whereas most stages typically occupy a few hundred pixels, the game world is comparatively infinite (-3.4E+38 to 3.4E+38 pixels in all directions).
- X: Horizontal axis. Items are measured left (lower values) to right (higher values). 0 is at the far left stage boundary.
- Y: Vertical axis. Items are measured from bottom to top, starting at the level’s default base.
- Z: Lateral axis. Lower Z values move objects away from the “camera”, higher Z values move it closer.
- Base: Base is a vertical axis value that determines an entity’s Y position when it isn’t jumping, flying, or falling. For instance, when an entity is in a normal stage area, its base is 0. If the entity jumps onto a platform 50 pixels high, its base is now 50.
Optionally, you may restrict movement to a single point on the Z axis. In this case OpenBOR will default to behaviors appropriate for two dimensional (i.e. “platfomer”) games.
Screen
The display screen where objects from the game world and any scripted sprites or text are drawn. Screen dimensions are measured in whole pixels. It goes without saying that any portion of an item out of the screen boundaries cannot be seen. Actual size of the screen depends on the module’s resolution settings.
- X: Horizontal axis. 0 (leftmost pixel) rightward to horizontal resolution.
- Y: Vertical axis. 0 (topmost pixel) downward to vertical resolution.
Screens by definition are flat and have no Z axis, as are most of the assets used in an OpenBOR game. In order to convey three dimensional movement OpenBOR uses a complex relationship between the Y axis and Z axis in concert with a layering hierarchy. For instance, as an object moves toward the “camera” (player’s point of view) on the game world Z axis, it will move downward along the screen’s Y axis. Additionally the object’s drawing order increases – meaning it is drawn later and therefore appears in front of objects further from the camera. This process is reversed as objects move away from the camera. Both relationships depend on the item in question and are largely automatic, but are all subject to various adjustments giving you direct control when needed. See individual articles for more details.
Note: Screen here refers to the actual video output sent to user’s physical screen. Don’t confuse this with scripted sub-screens (called “screens”), which are user defined virtual displays within the main screen.