Compare commits
31 Commits
acca8eb92b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| b70bdfb955 | |||
| 6de586ba01 | |||
| d0446e680d | |||
| 852394c54c | |||
| 4717ec0877 | |||
| 9ac5c35c90 | |||
| 1fb8296bcd | |||
| 1b8e4b2676 | |||
| dd8361cf33 | |||
| 4f20dce37f | |||
| eb36acac39 | |||
| ebe7c41578 | |||
| 97172aedf3 | |||
| 6ddf3b2949 | |||
| 4722783018 | |||
| 96d485aabb | |||
| d53b6a97c9 | |||
| eb5b39529a | |||
| af8fdfd30e | |||
| 2adbecea71 | |||
| 9187d8d9ef | |||
| a0b2aa96ad | |||
| cb1b0bb541 | |||
| 6e51b2f115 | |||
| 738e92c16b | |||
| 938160f053 | |||
| 75a173d0af | |||
| 3bb43edcee | |||
| b318adb469 | |||
| cee4d886c0 | |||
| cd313b363c |
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
textures/old/
|
||||||
5
README.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Daedalus
|
||||||
|
|
||||||
|
3D Maze Web game made with Three.js library
|
||||||
|
|
||||||
|

|
||||||
BIN
favicon.ico
Normal file
|
After Width: | Height: | Size: 762 B |
38
favicon.php
@ -2,43 +2,15 @@
|
|||||||
header('Content-Type: image/x-icon');
|
header('Content-Type: image/x-icon');
|
||||||
|
|
||||||
const SIZE = 16;
|
const SIZE = 16;
|
||||||
const WALL = 1;
|
|
||||||
const GROUND = 0;
|
|
||||||
|
|
||||||
$favicon = imagecreatetruecolor(SIZE, SIZE);
|
$x = filter_input(INPUT_GET, "x", FILTER_SANITIZE_NUMBER_INT);
|
||||||
$wallColor = imagecolorallocate($favicon, 165, 80, 30);
|
$y = filter_input(INPUT_GET, "y", FILTER_SANITIZE_NUMBER_INT);
|
||||||
$groundColor = imagecolorallocate($favicon, 203, 162, 133);
|
|
||||||
|
|
||||||
imagefill($favicon, 0, 0, $wallColor);
|
$favicon = imagecreatefrombmp("favicon.ico");
|
||||||
|
|
||||||
$maze = array();
|
$red = imagecolorallocate($favicon, 255, 0, 0);
|
||||||
for ($y = 0; $y < SIZE; $y++) {
|
imagesetpixel($favicon, $x, $y, $red);
|
||||||
$maze[$y] = array();
|
|
||||||
for ($x = 0; $x < SIZE; $x++) {
|
|
||||||
$maze[$y][$x] = WALL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function dig($position) {
|
|
||||||
global $maze;
|
|
||||||
global $favicon;
|
|
||||||
global $groundColor;
|
|
||||||
$directions = [[0, 1], [0, -1], [1, 0], [-1, 0]];
|
|
||||||
shuffle($directions);
|
|
||||||
foreach ($directions as $direction) {
|
|
||||||
$step1 = [$position[0] + $direction[0], $position[1] + $direction[1]];
|
|
||||||
$step2 = [$step1[0] + $direction[0], $step1[1] + $direction[1]];
|
|
||||||
if (0 <= $step2[1] and $step2[1] < SIZE and 0 <= $step2[0] and $step2[0] < SIZE and $maze[$step2[1]][$step2[0]] == WALL) {
|
|
||||||
$maze[$step1[1]][$step1[0]] = GROUND;
|
|
||||||
imagesetpixel($favicon, $step1[0], $step1[1], $groundColor);
|
|
||||||
$maze[$step2[1]][$step2[0]] = GROUND;
|
|
||||||
imagesetpixel($favicon, $step2[0], $step2[1], $groundColor);
|
|
||||||
dig($step2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dig([1, 1]);
|
|
||||||
imagebmp($favicon);
|
imagebmp($favicon);
|
||||||
imagedestroy($favicon);
|
imagedestroy($favicon);
|
||||||
?>
|
?>
|
||||||
31
index.html
@ -1,19 +1,28 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
<head>
|
<head>
|
||||||
<title>Daedalus</title>
|
|
||||||
<meta charset=utf-8 />
|
<meta charset=utf-8 />
|
||||||
|
<title>Daedalus</title>
|
||||||
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
|
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="favicon.php"/>
|
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" id="favicon"/>
|
||||||
|
<meta property="og:title" content="Daedalus"/>
|
||||||
|
<meta property="og:type" content="game"/>
|
||||||
|
<meta property="og:url" content="https://adrien.malingrey.fr/jeux/daedalus/"/>
|
||||||
|
<meta property="og:image" content="https://adrien.malingrey.fr/jeux/daedalus/thumbnail.png"/>
|
||||||
|
<meta property="og:image:width" content="250"/>
|
||||||
|
<meta property="og:image:height" content="250"/>
|
||||||
|
<meta property="og:description" content="Retrouvez la sortie"/>
|
||||||
|
<meta property="og:locale" content="fr_FR"/>
|
||||||
|
<meta property="og:site_name" content="adrien.malingrey.fr"/>
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<!-- Import maps polyfill -->
|
<!-- Import maps polyfill -->
|
||||||
<!-- Remove this when import maps will be widely supported -->
|
<!-- Remove this when import maps will be widely supported -->
|
||||||
<script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script>
|
<script async src="https://cdn.jsdelivr.net/npm/es-module-shims@1.8.3/dist/es-module-shims.min.js"></script>
|
||||||
<script type="importmap">
|
<script type="importmap">
|
||||||
{
|
{
|
||||||
"imports": {
|
"imports": {
|
||||||
"three": "https://unpkg.com/three@0.154/build/three.module.js?module",
|
"three": "https://cdn.jsdelivr.net/npm/three@0.169.0/build/three.module.min.js",
|
||||||
"three/addons/": "https://unpkg.com/three@0.154/examples/jsm/"
|
"three/addons/": "https://cdn.jsdelivr.net/npm/three@0.169.0/examples/jsm/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -142,15 +151,19 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="container"></div>
|
<div id="loading">
|
||||||
<span id="message" class="loading">
|
<div id="loadingMazeShadow">
|
||||||
|
<table id="loadingMazeTable"></table>
|
||||||
|
</div>
|
||||||
|
<div id="loadingMessage">Construction du labyrinthe : <span id="progress">0</span>%</div>
|
||||||
<div>
|
<div>
|
||||||
Se déplacer : ↑←↓→, ZQSD ou clic<br/>
|
Se déplacer : ↑←↓→, ZQSD ou clic<br/>
|
||||||
Sauter : ESPACE<br/>
|
Sauter : ESPACE<br/>
|
||||||
Regarder : Souris
|
Regarder : Souris
|
||||||
</div>
|
</div>
|
||||||
<div id="progressCircle" style="--progress: 0deg;">0%</div>
|
</div>
|
||||||
</span>
|
<div id="container"></div>
|
||||||
|
<span id="message"></span>
|
||||||
|
|
||||||
<script type="module" src="./main.js"></script>
|
<script type="module" src="./main.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
119
style.css
@ -1,9 +1,74 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background-color: #000;
|
background-color: #041626;
|
||||||
color: #fff;
|
font-size: 1.3em;
|
||||||
font-family: Georgia, serif;
|
|
||||||
overscroll-behavior: none;
|
overscroll-behavior: none;
|
||||||
|
cursor: progress;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loading {
|
||||||
|
width: fit-content;
|
||||||
|
color: #2c5c88;
|
||||||
|
font-size: 1.3em;
|
||||||
|
top: 20vh;
|
||||||
|
margin: auto;
|
||||||
|
font-family: sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loadingMessage {
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes perspective {
|
||||||
|
from {
|
||||||
|
transform: rotateX(0deg) perspective(0px);
|
||||||
|
filter: drop-shadow(0px 00px 0px #0f2437);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: rotateX(40deg) perspective(150px);
|
||||||
|
filter: drop-shadow(0px 10px 0px #0f2437);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#loadingMazeShadow {
|
||||||
|
width: 230px;
|
||||||
|
height: 230px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
margin-top: 20vh;
|
||||||
|
margin-bottom: 5vh;
|
||||||
|
animation: perspective 30s;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes rotation {
|
||||||
|
from {
|
||||||
|
transform: rotateZ(0deg);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: rotateZ(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#loadingMazeTable {
|
||||||
|
border-collapse: collapse;
|
||||||
|
animation: rotation 60s infinite;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loadingMazeTable td {
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
transition: background-color 1s;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wall {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ground {
|
||||||
|
background-color: #214464;
|
||||||
}
|
}
|
||||||
|
|
||||||
#container {
|
#container {
|
||||||
@ -32,58 +97,18 @@ body {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
color: gray;
|
color: gray;
|
||||||
}
|
font-family: serif;
|
||||||
|
|
||||||
#message.loading {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
top: 20vh;
|
|
||||||
width: 100%;
|
|
||||||
margin: auto;
|
|
||||||
align-items: center;
|
|
||||||
gap: 5rem;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 1.7em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#progressCircle {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
position: relative;
|
|
||||||
width: 200px;
|
|
||||||
height: 200px;
|
|
||||||
border: 4px solid dimgray;
|
|
||||||
border-radius: 50%;
|
|
||||||
font-size: 0;
|
|
||||||
font-size: 3vh;
|
|
||||||
font-weight: 700;
|
|
||||||
font-family: system-ui;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
#progressCircle::after {
|
|
||||||
content: "";
|
|
||||||
display: flex;
|
|
||||||
position: absolute;
|
|
||||||
width: 200px;
|
|
||||||
height: 200px;
|
|
||||||
top: -4px;
|
|
||||||
left: -4px;
|
|
||||||
border: 4px solid #1da8b7;
|
|
||||||
border-radius: 50%;
|
|
||||||
mask: conic-gradient(black var(--progress), transparent var(--progress));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#message a {
|
#message a {
|
||||||
text-decoration: none;
|
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
#message.escaped {
|
#message.escaped {
|
||||||
display: flex;
|
display: block;
|
||||||
opacity: 100%;
|
opacity: 100%;
|
||||||
font-size: 10vh;
|
font-size: 4vh;
|
||||||
|
text-align: center;
|
||||||
top: 30vh;
|
top: 30vh;
|
||||||
animation: escaped 5s;
|
animation: escaped 5s;
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
textures/Poly-cobblestone-wall/ao_map.jpg
Normal file
|
After Width: | Height: | Size: 4.8 MiB |
BIN
textures/Poly-cobblestone-wall/ao_map.webp
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
textures/Poly-cobblestone-wall/color_map.jpg
Normal file
|
After Width: | Height: | Size: 7.3 MiB |
BIN
textures/Poly-cobblestone-wall/color_map.webp
Normal file
|
After Width: | Height: | Size: 2.4 MiB |
BIN
textures/Poly-cobblestone-wall/displacement_map.jpg
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
BIN
textures/Poly-cobblestone-wall/displacement_map.webp
Normal file
|
After Width: | Height: | Size: 209 KiB |
BIN
textures/Poly-cobblestone-wall/normal_map_opengl.jpg
Normal file
|
After Width: | Height: | Size: 5.7 MiB |
BIN
textures/Poly-cobblestone-wall/normal_map_opengl.webp
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
textures/Poly-cobblestone-wall/render_map.jpg
Normal file
|
After Width: | Height: | Size: 7.4 MiB |
BIN
textures/Poly-cobblestone-wall/render_map.webp
Normal file
|
After Width: | Height: | Size: 2.4 MiB |
BIN
textures/Poly-cobblestone-wall/roughness_map.jpg
Normal file
|
After Width: | Height: | Size: 2.6 MiB |
BIN
textures/Poly-cobblestone-wall/roughness_map.webp
Normal file
|
After Width: | Height: | Size: 324 KiB |
@ -1,20 +1,20 @@
|
|||||||
{
|
{
|
||||||
"prompt_text": "stone retaining wall, extreme fine details",
|
"prompt_text": "cobblestone wall with grass and flowers between rocks",
|
||||||
"patch": {
|
"patch": {
|
||||||
"ext": "png",
|
"ext": "png",
|
||||||
"dtype": "uint8",
|
"dtype": "uint8",
|
||||||
"width": 512,
|
"width": 512,
|
||||||
"height": 512,
|
"height": 512,
|
||||||
"url": "https://static-dev.withpoly.com/v3-voronoi/textures/patches/909585e0-8b3f-4659-ae84-03f58ceaaaeb.png",
|
"url": "https://static-dev.withpoly.com/v3-voronoi/textures/patches/486f8eed-0dfd-4bdc-9dee-3776fc72b1f1.png",
|
||||||
"patch_id": "EbJzaafatu"
|
"patch_id": "GVpEsGuQ8S"
|
||||||
},
|
},
|
||||||
"seamless_prompt_text": "stone retaining wall, extreme fine details",
|
"seamless_prompt_text": "cobblestone wall with grass and flowers between rocks",
|
||||||
"seamless_patch_scale": 0.8,
|
"seamless_patch_scale": 0.98,
|
||||||
"upscale_prompt_text": "stone retaining wall, extreme fine details",
|
"upscale_prompt_text": "cobblestone wall with grass and flowers between rocks",
|
||||||
"upscale_resolution": 4096,
|
"upscale_resolution": 4096,
|
||||||
"is_seamless": true,
|
"is_seamless": true,
|
||||||
"pbr_mode": "organic",
|
"pbr_mode": "organic",
|
||||||
"pbr_generate_color": true,
|
"pbr_use_render_as_color": true,
|
||||||
"pbr_generate_normal": true,
|
"pbr_generate_normal": true,
|
||||||
"pbr_generate_height": true,
|
"pbr_generate_height": true,
|
||||||
"pbr_generate_ao": true,
|
"pbr_generate_ao": true,
|
||||||
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 32 KiB |
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"prompt_text": "raft wood",
|
|
||||||
"patch": {
|
|
||||||
"ext": "png",
|
|
||||||
"dtype": "uint8",
|
|
||||||
"width": 512,
|
|
||||||
"height": 512,
|
|
||||||
"url": "https://static.withpoly.com/v3-voronoi/textures/patches/43d5b37f-e2e2-4f85-b2a9-b9135346748e.png",
|
|
||||||
"patch_id": "Td9yL3mXYo"
|
|
||||||
},
|
|
||||||
"seamless_prompt_text": "raft wood",
|
|
||||||
"seamless_patch_scale": 0.8,
|
|
||||||
"upscale_prompt_text": "raft wood",
|
|
||||||
"upscale_resolution": 1024,
|
|
||||||
"is_seamless": true,
|
|
||||||
"pbr_mode": "general",
|
|
||||||
"pbr_generate_color": true,
|
|
||||||
"pbr_generate_normal": true,
|
|
||||||
"pbr_generate_height": true,
|
|
||||||
"pbr_generate_ao": true,
|
|
||||||
"pbr_generate_roughness": true
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 497 KiB |
|
Before Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 2.3 MiB |
|
Before Width: | Height: | Size: 828 KiB |
BIN
textures/Poly-wood/ao_map.jpg
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
textures/Poly-wood/ao_map.webp
Normal file
|
After Width: | Height: | Size: 372 KiB |
BIN
textures/Poly-wood/color_map.jpg
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
textures/Poly-wood/color_map.webp
Normal file
|
After Width: | Height: | Size: 595 KiB |
BIN
textures/Poly-wood/displacement_map.jpg
Normal file
|
After Width: | Height: | Size: 542 KiB |
BIN
textures/Poly-wood/displacement_map.webp
Normal file
|
After Width: | Height: | Size: 184 KiB |
BIN
textures/Poly-wood/normal_map_opengl.jpg
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
textures/Poly-wood/normal_map_opengl.webp
Normal file
|
After Width: | Height: | Size: 803 KiB |
BIN
textures/Poly-wood/render_map.jpg
Normal file
|
After Width: | Height: | Size: 2.0 MiB |
BIN
textures/Poly-wood/render_map.webp
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
textures/Poly-wood/roughness_map.jpg
Normal file
|
After Width: | Height: | Size: 475 KiB |
BIN
textures/Poly-wood/roughness_map.webp
Normal file
|
After Width: | Height: | Size: 128 KiB |
23
textures/Poly-wood/settings.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"prompt_text": "wood, planks, wooden, green paint, painted wood, paint, scrathes, raw wood, peeling paint",
|
||||||
|
"patch": {
|
||||||
|
"ext": "png",
|
||||||
|
"dtype": "uint8",
|
||||||
|
"width": 512,
|
||||||
|
"height": 512,
|
||||||
|
"url": "https://static-dev.withpoly.com/v3-voronoi/textures/patches/0ddfc901-a5dd-40f0-993b-8de3ccefb7f7.png",
|
||||||
|
"patch_id": "a79eceALs5"
|
||||||
|
},
|
||||||
|
"seamless_prompt_text": "wood, planks, wooden, green paint, painted wood, paint, scrathes, raw wood, peeling paint",
|
||||||
|
"seamless_patch_scale": 0.8,
|
||||||
|
"upscale_prompt_text": "wood, planks, wooden, green paint, painted wood, paint, scrathes, raw wood, peeling paint",
|
||||||
|
"upscale_resolution": 4096,
|
||||||
|
"is_seamless": true,
|
||||||
|
"pbr_mode": "matte",
|
||||||
|
"pbr_generate_color": true,
|
||||||
|
"pbr_generate_normal": true,
|
||||||
|
"pbr_generate_height": true,
|
||||||
|
"pbr_generate_ao": true,
|
||||||
|
"pbr_generate_roughness": true,
|
||||||
|
"pbr_generate_metallic": false
|
||||||
|
}
|
||||||
BIN
textures/angled-blocks-vegetation/albedo.webp
Normal file
|
After Width: | Height: | Size: 566 KiB |
BIN
textures/angled-blocks-vegetation/ao-roughness-metalness.png
Normal file
|
After Width: | Height: | Size: 2.3 MiB |
BIN
textures/angled-blocks-vegetation/ao-roughness-metalness.webp
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
textures/angled-blocks-vegetation/ao.webp
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
textures/angled-blocks-vegetation/height.webp
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
textures/angled-blocks-vegetation/metallic.webp
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
textures/angled-blocks-vegetation/normal-dx.webp
Normal file
|
After Width: | Height: | Size: 1.5 MiB |
BIN
textures/angled-blocks-vegetation/roughness.webp
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
textures/calm-sea-skybox/bk.webp
Normal file
|
After Width: | Height: | Size: 160 KiB |
BIN
textures/calm-sea-skybox/dn.webp
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
textures/calm-sea-skybox/ft.webp
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
textures/calm-sea-skybox/lf.webp
Normal file
|
After Width: | Height: | Size: 69 KiB |
BIN
textures/calm-sea-skybox/rt.webp
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
textures/calm-sea-skybox/up.webp
Normal file
|
After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 7.0 MiB |
|
Before Width: | Height: | Size: 556 KiB |
|
Before Width: | Height: | Size: 5.6 MiB |
|
Before Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 9.6 MiB |
|
Before Width: | Height: | Size: 2.4 MiB |
BIN
textures/waternormals.webp
Normal file
|
After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 115 KiB |