npm install @artomata/pentaflower
const Pentaflower = require('@artomata/pentaflower')
const myFlower = new Pentaflower({ rings: 50 })
const Pentaflower = window.Pentaflower
const myFlower = new Pentaflower({ rings: 50 })
myFlower.setState(3) // sets the 4th pentagon state to true (i.e. alive)
myFlower.progress() // moves pentaflower to the next state
myFlower.getDimensions() // returns useful info about dimensions of pentaflower
See Pentagon API below for more information about the returned objects.
const pentagons = myFlower.pentagons // array of all of the pentagon objects
const points = myFlower.pentagons[0].points // array of point objects
const x = points[0].x
const y = points[0].y
const state = myFlower.pentagons[0].getState() // boolean; true is alive