-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaquarium.html
98 lines (83 loc) · 3.09 KB
/
aquarium.html
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
<!DOCTYPE html>
<html>
<head>
<title>Games - Aquarium</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/processing.js/1.6.0/processing.min.js"></script>
<link href="style.css" rel="stylesheet">
</head>
<body>
<!-- ================================
Start Navigation Bar
================================= -->
<header>
<div class="headerCol">
<div class="container-fluid">
<div class="row align-items-center">
<div class="col">
<div class="navCollapseCol">
<div class="navCol">
<ul>
<li><a href="index.html">Mustachio</a></li>
<li><a href="drop.html">Drop</a></li>
<li><a href="BallUppAndDown.html">Ball Upp and Down</a></li>
<li><a href="aquarium.html">Aquarium</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- ================================
End Navigation Bar
================================= -->
<div class="content"></div>
<h1>Aquarium</h1>
<p>A Litle Nice Aquarium With Fish Siming</p>
<script type="application/processing">
xSize = 800;
ySize = 800;
void setup() {
size(xSize, ySize);
}
var drawFish = function(centerX,centerY,bodyLength,bodyHeight, bodyColor,eyesize){
centerX = centerX % xSize;
noStroke();
fill(bodyColor[0], bodyColor[1], bodyColor[2]);
// body
ellipse(centerX, centerY, bodyLength, bodyHeight);
// tail
var tailWidth = bodyLength/4;
var tailHeight = bodyHeight/2;
triangle(centerX-bodyLength/2, centerY,
centerX-bodyLength/2-tailWidth, centerY-tailHeight,
centerX-bodyLength/2-tailWidth, centerY+tailHeight);
// eye
fill(33, 33, 33);
ellipse(centerX+bodyLength/4, centerY, bodyHeight/eyesize, bodyHeight/eyesize);
};
x = 0
draw = function() {
background(89, 216, 255);
x++;
//x = x%300
//TODO Random speeds
//Coler background
blue = [34, 78, 232]
orange = [134, 28, 32]
green = [34, 278, 32]
drawFish(466+x, 426, 160, 66, blue ,52);
drawFish(250*2+x*2, 100, 62, 94, red, 4);
drawFish(650+x, 418, 42, 84, blue, 6);
drawFish(300+x*0.5, 450, 128, 132, green, 6);
drawFish(500+x, 714, 44, 42, blue, 4);
drawFish(150+x, 302, 46, 114, green, 6);
drawFish(300+x, 722, 130, 36, green, 2);
drawFish(700+x*2, 200, 68, 110, red, 4);
}
</script>
<canvas> </canvas>
</div>
</body>
</html>