configurable refresh rate for 2d CA
This commit is contained in:
@ -26,7 +26,8 @@ export default {
|
||||
rules: 'getRuleSet1d',
|
||||
drawing: 'isDrawing',
|
||||
canvasWidth: 'getCanvasWidth',
|
||||
canvasHeight: 'getCanvasHeight'
|
||||
canvasHeight: 'getCanvasHeight',
|
||||
refreshRate: 'getRefreshRate'
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
@ -82,7 +83,7 @@ export default {
|
||||
if (this.drawing === 0) return
|
||||
const newBoard = evolve2d(b, conwayRules)
|
||||
this.drawCanvas(b, this.cellProperties)
|
||||
await sleep(300)
|
||||
await sleep(this.refreshRate)
|
||||
draw2dNext(newBoard)
|
||||
}
|
||||
return draw2dNext(board)
|
||||
|
||||
Reference in New Issue
Block a user