General update
This commit is contained in:
13
GameOfLife/index.html
Normal file → Executable file
13
GameOfLife/index.html
Normal file → Executable file
@@ -269,7 +269,13 @@
|
||||
|
||||
draw();
|
||||
|
||||
|
||||
var looping = false;
|
||||
setInterval(function(){
|
||||
if(looping){
|
||||
hue = hue+0.01;
|
||||
hue = hue>1?0:hue;
|
||||
}
|
||||
},400);
|
||||
|
||||
document.addEventListener ('keydown', function (event) {
|
||||
if (event.which == 38) {
|
||||
@@ -284,7 +290,10 @@
|
||||
}
|
||||
else if(event.which == 39){
|
||||
speed = Math.max(speed-0.01, 0.1 );
|
||||
}
|
||||
}
|
||||
if (event.which == 32){
|
||||
looping = looping?false:true;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user