commit 358ee534d9abd9800f3e096443a711084e9c87f0
Author: root <root@hub.scroll.pub> Date: 2024-12-27 16:07:00 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..36128bd --- /dev/null +++ b/body.html @@ -0,0 +1,10 @@ +<header> + <h1>Minecraft-like 3D Game</h1> + <p>Explore and build in this simple 3D world!</p> +</header> +<main> + <canvas id="gameCanvas"></canvas> +</main> +<footer> + <p>Use arrow keys to move and space to jump. Have fun!</p> +</footer> \ No newline at end of file diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..08a5a0b --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://minecraft3d.scroll.pub +metaTags +editButton /edit.html +title Minecraft-like 3D Game +style.css +body.html +script.js \ No newline at end of file diff --git a/prompt.json b/prompt.json new file mode 100644 index 0000000..b26fb73 --- /dev/null +++ b/prompt.json @@ -0,0 +1,25 @@ +{ + "id": "34279921-2eb4-4230-ae63-22be709eade0", + "object": "chat.completion", + "created": 1735315605, + "model": "deepseek-chat", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "---domain---\nminecraft3d.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://minecraft3d.scroll.pub\nmetaTags\neditButton /edit.html\ntitle Minecraft-like 3D Game\nstyle.css\nbody.html\nscript.js\n---body.html---\n<header>\n <h1>Minecraft-like 3D Game</h1>\n <p>Explore and build in this simple 3D world!</p>\n</header>\n<main>\n <canvas id=\"gameCanvas\"></canvas>\n</main>\n<footer>\n <p>Use arrow keys to move and space to jump. Have fun!</p>\n</footer>\n---style.css---\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: 'Arial', sans-serif;\n background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);\n color: #fff;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n}\n\nheader {\n margin-bottom: 2rem;\n}\n\nh1 {\n font-size: 2.5rem;\n text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);\n}\n\np {\n font-size: 1.2rem;\n margin-top: 0.5rem;\n}\n\ncanvas {\n width: 100%;\n max-width: 800px;\n height: 600px;\n background: #87CEEB;\n border: 4px solid #fff;\n box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);\n border-radius: 10px;\n}\n\nfooter {\n margin-top: 2rem;\n font-size: 0.9rem;\n opacity: 0.8;\n}\n\n@media (max-width: 768px) {\n h1 {\n font-size: 2rem;\n }\n\n p {\n font-size: 1rem;\n }\n\n canvas {\n height: 400px;\n }\n}\n---script.js---\nconst canvas = document.getElementById('gameCanvas');\nconst ctx = canvas.getContext('2d');\n\nconst player = {\n x: canvas.width / 2,\n y: canvas.height / 2,\n size: 20,\n speed: 5,\n color: '#FF6347'\n};\n\nconst keys = {\n ArrowUp: false,\n ArrowDown: false,\n ArrowLeft: false,\n ArrowRight: false,\n Space: false\n};\n\nfunction drawPlayer() {\n ctx.fillStyle = player.color;\n ctx.fillRect(player.x - player.size / 2, player.y - player.size / 2, player.size, player.size);\n}\n\nfunction updatePlayer() {\n if (keys.ArrowUp && player.y > player.size / 2) {\n player.y -= player.speed;\n }\n if (keys.ArrowDown && player.y < canvas.height - player.size / 2) {\n player.y += player.speed;\n }\n if (keys.ArrowLeft && player.x > player.size / 2) {\n player.x -= player.speed;\n }\n if (keys.ArrowRight && player.x < canvas.width - player.size / 2) {\n player.x += player.speed;\n }\n if (keys.Space && player.y === canvas.height - player.size / 2) {\n player.y -= 50;\n }\n}\n\nfunction gameLoop() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n \n // Draw ground\n ctx.fillStyle = '#228B22';\n ctx.fillRect(0, canvas.height - 50, canvas.width, 50);\n \n updatePlayer();\n drawPlayer();\n \n requestAnimationFrame(gameLoop);\n}\n\nwindow.addEventListener('keydown', (e) => {\n if (keys.hasOwnProperty(e.key)) {\n keys[e.key] = true;\n }\n});\n\nwindow.addEventListener('keyup', (e) => {\n if (keys.hasOwnProperty(e.key)) {\n keys[e.key] = false;\n }\n});\n\ngameLoop();\n---end---" + }, + "logprobs": null, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 251, + "completion_tokens": 926, + "total_tokens": 1177, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 251 + }, + "system_fingerprint": "fp_f1afce2943" +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..dc1177a --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# minecraft3d.scroll.pub +Website generated by DeepSeek from prompt: i want a website that have a minecraft like 3d game i can play \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..768530c --- /dev/null +++ b/script.js @@ -0,0 +1,68 @@ +const canvas = document.getElementById('gameCanvas'); +const ctx = canvas.getContext('2d'); + +const player = { + x: canvas.width / 2, + y: canvas.height / 2, + size: 20, + speed: 5, + color: '#FF6347' +}; + +const keys = { + ArrowUp: false, + ArrowDown: false, + ArrowLeft: false, + ArrowRight: false, + Space: false +}; + +function drawPlayer() { + ctx.fillStyle = player.color; + ctx.fillRect(player.x - player.size / 2, player.y - player.size / 2, player.size, player.size); +} + +function updatePlayer() { + if (keys.ArrowUp && player.y > player.size / 2) { + player.y -= player.speed; + } + if (keys.ArrowDown && player.y < canvas.height - player.size / 2) { + player.y += player.speed; + } + if (keys.ArrowLeft && player.x > player.size / 2) { + player.x -= player.speed; + } + if (keys.ArrowRight && player.x < canvas.width - player.size / 2) { + player.x += player.speed; + } + if (keys.Space && player.y === canvas.height - player.size / 2) { + player.y -= 50; + } +} + +function gameLoop() { + ctx.clearRect(0, 0, canvas.width, canvas.height); + + // Draw ground + ctx.fillStyle = '#228B22'; + ctx.fillRect(0, canvas.height - 50, canvas.width, 50); + + updatePlayer(); + drawPlayer(); + + requestAnimationFrame(gameLoop); +} + +window.addEventListener('keydown', (e) => { + if (keys.hasOwnProperty(e.key)) { + keys[e.key] = true; + } +}); + +window.addEventListener('keyup', (e) => { + if (keys.hasOwnProperty(e.key)) { + keys[e.key] = false; + } +}); + +gameLoop(); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..26c0c02 --- /dev/null +++ b/style.css @@ -0,0 +1,61 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: 'Arial', sans-serif; + background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); + color: #fff; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + text-align: center; +} + +header { + margin-bottom: 2rem; +} + +h1 { + font-size: 2.5rem; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); +} + +p { + font-size: 1.2rem; + margin-top: 0.5rem; +} + +canvas { + width: 100%; + max-width: 800px; + height: 600px; + background: #87CEEB; + border: 4px solid #fff; + box-shadow: 0 0 20px rgba(255, 255, 255, 0.3); + border-radius: 10px; +} + +footer { + margin-top: 2rem; + font-size: 0.9rem; + opacity: 0.8; +} + +@media (max-width: 768px) { + h1 { + font-size: 2rem; + } + + p { + font-size: 1rem; + } + + canvas { + height: 400px; + } +} \ No newline at end of file