Class: Plane

Plane

new Plane(p_init)

Parameters:
Name Type Description
p_init Object Should contain the attributes canvasID (the id of the canvas tag), colsNr (the number of columns of the plane), rowsNr (the number of rows of the plane), item (the initialization object for the items that are placed on the plane).
Source:

Methods

addFood()

Places food on some empty place of the plane.
Source:

addItem(p_item)

Adds an item to the plane.
Parameters:
Name Type Description
p_item $app$.game.snake.Item The item to be added.
Source:

getItem(p_x, p_y) → {$app$.game.snake.Item}

Returns the item currently being placed on a specific field of the plane.
Parameters:
Name Type Description
p_x int The x-position of the item to be fetched.
p_y int The y-position of the item to be fetched.
Source:
Returns:
The item at position (p_x, p_y) of the field.
Type
$app$.game.snake.Item

removeItem(p_item)

Removes an item from the plane.
Parameters:
Name Type Description
p_item $app$.game.snake.Item The item to be removed.
Source:

reset()

Resets the plane.
Source:
W. Kowarschick © 2013 (CC BY-NC-SA 3.0: http://creativecommons.org/licenses/by-nc-sa/3.0/)
Documentation generated by JSDoc 3.3.0-dev on Sun Dec 15 2013 11:28:52 GMT+0100 (MEZ) using the DocStrap template.