Class: Branch

Branch()

class used to generate a single branch for rope sprite

Constructor

new Branch()

Source:

Methods

addNodeToRow(row, position, out, deadZone) → {boolean|Array}

generate a new node at the row and position specified

Parameters:
Name Type Description
row number

the row we are building on, 0 is middle (root row);
odd rows are above 0, even rows below

position number

the point on the row that we are starting at

out boolean

true if current branch is branching away from center

deadZone Map.<Object>

map of objects that explicitly specifies where a branch cannot grow

Source:
Returns:

if array - [endPosition, success]

Type
boolean | Array

newNode()

generate a new node

Source:

populateBranch(row, position, out, deadZone)

fill the branch recursively

Parameters:
Name Type Description
row number

the row we are building on, 0 is middle (root row);
odd rows are above 0, even rows below

position number

the point on the row that we are starting at

out boolean

true if current branch is branching away from center

deadZone Map.<Object>

map of objects that explicitly specifies where a branch cannot grow

Source:

rowExists()

check if the row exists

Source:

rowOpen()

check if there is open space here

Source: