keep stats
This commit is contained in:
parent
51848cab3d
commit
d44076b32c
1 changed files with 4 additions and 0 deletions
|
@ -12,6 +12,7 @@ export function IslandApplet() {
|
|||
// STATE
|
||||
|
||||
let timerId: number;
|
||||
let ticks = 0;
|
||||
let islands = new IslandGrid(WIDTH, HEIGHT, DEFAULT_SEED);
|
||||
|
||||
// UI
|
||||
|
@ -30,12 +31,15 @@ export function IslandApplet() {
|
|||
onclick: () => {
|
||||
clearInterval(timerId);
|
||||
|
||||
ticks = 0;
|
||||
islands = new IslandGrid(WIDTH, HEIGHT, seedInput.valueAsNumber);
|
||||
|
||||
timerId = setInterval(function tick() {
|
||||
islands.step();
|
||||
islands.step();
|
||||
islands.step();
|
||||
|
||||
ticks += 3;
|
||||
if (islands.done) {
|
||||
clearInterval(timerId);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue