Commit 32ad25da authored by Sander Kvenild's avatar Sander Kvenild
Browse files

Now adding a new bubble every second

parent 70d8021e
......@@ -53,14 +53,19 @@
var bobler = [];
for(let i = 0; i < 10; i++) {
let x = Math.floor(Math.random() * canvas.width);
let y = Math.floor(Math.random() * canvas.height);
let r = Math.floor(Math.random() * 40 + 10);
bobler[i] = new Boble(x,y,r);
nyBoble();
}
setInterval(tegn,100);
setInterval(nyBoble, 1000);
function nyBoble() {
let x = Math.floor(Math.random() * canvas.width);
let y = Math.floor(Math.random() * canvas.height);
let r = Math.floor(Math.random() * 40 + 10);
bobler.push(new Boble(x,y,r));
}
function tegn() {
reset();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment