-
Notifications
You must be signed in to change notification settings - Fork 0
/
Basis-6-10.js
82 lines (62 loc) · 5.95 KB
/
Basis-6-10.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
window.onmousemove = function (e)
{
var x = e.pageX,
y = e.pageY;
moveThis.style.top = (y - 50);
moveThis.style.left =(x - 50);
};
window.onload = function() {
console.log('eerste');
setTimeout(intervalRoutine2, 1);
intervalRoutine();
}
intervalRoutine2 = function () {
console.log('tweede');
if(tijd == true) {
timeleft--;
moveThis.style.zIndex = 7;
document.getElementById("countdowntimer").textContent = timeleft;
if(timeleft <= 0) {
window.location.replace("../Game Over/Game Over.html");
}
if (timeleft <= 9){
document.getElementById("tijd").style.left = 110 + "px";
}
}
setTimeout(intervalRoutine2, 1000);
}
intervalRoutine = function () {
console.log('derde');
var blokje = document.getElementById('finish');
var xy = getRandomPosition(blokje);
blokje.style.top = xy[0] + 'px';
blokje.style.left = xy[1] + 'px';
}
var moveThis = document.getElementById('flash');
console.log(window);
var clicks = 0
function clicker()
{
clicks += 1;
document.getElementById('clicks').innerHTML = clicks;
document.getElementById('zoeksleutel').style.display="none";
}
var tijd = true;
function pause(){
tijd = false;
bok.style.zIndex = 94;
document.getElementById('resume').style.display='block';
}
function resume(){
tijd = true;
bok.style.zIndex = 1;
document.getElementById('resume').style.display='none';
}
var bok = document.getElementById('flash')
function getRandomPosition(element) {
var x = document.body.offsetHeight-element.clientHeight;
var y = document.body.offsetWidth-element.clientWidth;
var randomX = Math.floor(Math.random()*x);
var randomY = Math.floor(Math.random()*y);
return [randomX,randomY];
}