-
Notifications
You must be signed in to change notification settings - Fork 0
/
teste.txt
100 lines (82 loc) · 2.54 KB
/
teste.txt
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
var canvas = document.querySelector('canvas');
canvas.width = window.innerWidth
canvas.height = window.innerHeight
var c = canvas.getContext('2d');
window.addEventListener('resize', function(){
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
})
for (var i = 0; i < 5; i++){
var a = 1 - Math.random()*0.9
c.beginPath();
c.arc(100 + 150*i, 400, 50, 0, Math.PI*2, true);
c.strokeStyle = "rgb(0,0,0)";
c.fillStyle = "rgba(255,255,0,"+a+")";
c.stroke();
c.fill();
}
if (this.xm > innerWidth/2-125){
this.dxm = -this.dxm;
this.t += 1;
}
if ((this.xm - 6 <= circleArray[0].x - 30 -innerWidth/2+125) && (this.t == 1 )){
this.dxm = 0;
if (this.ym < circleArray[0].y - 148){
this.ym += 3*this.dym;
} else{
this.t +=1;
}
}
if (this.t == 2){
if (this.ym > 0){
this.ym -= 3*this.dym;
circleArray[0].y -= 3*this.dym;
circleArray[1].y -= 3*this.dym;
} else {
this.t +=1;
}
}
if(this.t ==3){
if (circleArray[0].g > circleArray[1].g){
circleArray[0].x += 200;
circleArray[1].x -=200;
this.t = 4;
} else{
this.t =4;
}
}
if(this.t == 4){
if (this.ym < circleArray[2].y - 148){
this.ym += 3*this.dym;
circleArray[0].y += 3*this.dym;
circleArray[1].y += 3*this.dym;
} else{
this.t+=1;
}
}
if(this.t ==5 ){
if(this.ym >0){
this.ym -= 3*this.dym;
}
}
c.beginPath();
c.rect(this.xm + innerWidth/2+75, this.ym + 175, 50, 50)
c.fillStyle = "rgb(160,160,160)";
c.strokeStyle = "rgb(0,0,0)";
c.stroke();
c.fill();
c.beginPath();
c.rect(this.xm + innerWidth/2-125, this.ym + 175, 50, 50)
c.fillStyle = "rgb(160,160,160)";
c.strokeStyle = "rgb(0,0,0)";
c.stroke();
c.fill();
if (this.xm > (innerWidth/2-125)- (3 - this.k)*(300-5*this.k)) {
this.dxm = -this.dxm;
this.t += 1;
c.beginPath();
c.rect(this.xh, this.yh + 175, 50, 50)
c.fillStyle = "#A6808C";
c.strokeStyle = "rgb(0,0,0)";
c.stroke();
c.fill();