configurable refresh rate for 2d CA

This commit is contained in:
Gator
2022-01-10 20:49:09 +01:00
parent 980be551c1
commit 6f1e813316
3 changed files with 30 additions and 3 deletions

View File

@ -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)