html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!--
NAME : Weird game
DATE : January 08, 2021
AUTHOR : lolo
-->
<!DOCTYPE html>
<html>
<head>
<title>Weird game</title>
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@700&display=swap" rel="stylesheet">
</head>
<body>
<canvas id="cnv"></canvas>
<div id="outlevel">LEVEL 1</div>
<div id="again" onclick="tryAgain()">TRY AGAIN</div>
<div id="info">
<p> USE TWO FINGERS TO PLAY AND DO NOT TOUCH THE BALLS</p>
<div onclick="init()" id="play">PLAY</div>
</div>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
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
body
{
position:fixed;
background-color: black;
margin:0;
user-select: none;
-webkit-user-select : none;
overflow:hidden;
font-family: 'Ubuntu', sans-serif;
width: 100%;
height:100%;
}
#info
{
position:absolute;
width:350px;
height:100px;
margin:auto;
left:0;top:0;right:0;bottom:0;
transform: rotate(90deg);
color: white;
z-index: 2;
background-color: black;
text-align: center;
box-shadow: inset 0 0 5px gray;
border-radius: 10px;
font-size:1em;
padding:5px;
Enter to Rename, Shift+Enter to Preview
js
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
let W, H, c, ctx
let touchs
let bombs = []
let widthPlayer = 60
let level = speed = 1
let interval, intervalValue = 1000, intervalNextLevel
let lifeLeft = lifeRight = 4
let stop = false
let checkVibrate = window.navigator && window.navigator.vibrate;
const random = (max=1, min=0) => Math.random() * (max - min) + min
const coll = (x0, y0, r0, x1, y1, r1) => Math.hypot(x0-x1, y0-y1)<r0+r1 ? true : false
const clear = () => {
ctx.fillStyle = '#000'
ctx.fillRect(0,0,W,H)
}
const radColor = (x0, y0, r0, x1, y1, r1, color, ad) => {
let NG = ctx.createRadialGradient(x0, y0, r0, x1, y1+ad, r1)
NG.addColorStop(0, color)
NG.addColorStop(1, 'black')
return NG;
}
class Bomb{
constructor(x,y,r,s) {
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Laufen