Difference between revisions of "GameBoard Object"

From BOARD18 Project WIKI
Jump to navigation Jump to search
(Added Data Elements table)
 
(4 intermediate revisions by the same user not shown)
Line 47: Line 47:


An * in the "C" column indicates that the element is created by the constructor function.
An * in the "C" column indicates that the element is created by the constructor function.
== Methods in Object ==
'''place()'''
The place function places the game board on canvas1.
'''clear2()'''
The clear2 function clears all tokens from canvas2.
'''hexCoord(xPix, yPix)'''
The hexCoord function calculates the board coordinates of the containing map hex given an exact position in pixels on the game board.<br><br>
'''[[Type_%22F%22_Board_Map_Glitch|<span style="color: Green">This note</span>]] describes a potential problem with the interaction of type "F" board maps and the hexCoord function.'''
[[Category:Design]]

Latest revision as of 07:45, 14 October 2017

This page describes a BOARD18 JavaScript object.
This object is created using the GameBoard constructor function.
Go to Object List. - Go to Design Document.

The GameBoard object describes a game board and its use.

Data Elements in Object
Element Type C Description
image url * URL of the image file
height int * Board image height
width int * Board image width
xStart int * Start of board hexes
xStep int * Spacing of board hexes
yStart int * Start of board hexes
yStep int * Spacing of board hexes

An * in the "C" column indicates that the element is created by the constructor function.

Methods in Object

place() The place function places the game board on canvas1.

clear2() The clear2 function clears all tokens from canvas2.

hexCoord(xPix, yPix) The hexCoord function calculates the board coordinates of the containing map hex given an exact position in pixels on the game board.

This note describes a potential problem with the interaction of type "F" board maps and the hexCoord function.