Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sander Kvenild
DCST1007 - OOP
Commits
32ad25da
Commit
32ad25da
authored
Feb 03, 2022
by
Sander Kvenild
Browse files
Now adding a new bubble every second
parent
70d8021e
Changes
1
Hide whitespace changes
Inline
Side-by-side
js-ov13-oop3-sander-kvenild/minebobler.html
View file @
32ad25da
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment