Add stats screen, change name to Blockly.IO

This commit is contained in:
theKidOfArcrania 2017-03-04 12:44:27 +00:00
parent c18d656eb1
commit f83ca3dc04
7 changed files with 4019 additions and 3982 deletions

View File

@ -1,4 +1,4 @@
# Paper.IO # Blockly.IO
This is a clone of the original Paper-IO released by Voodoo, except for one aspect. This will attempt to implement a multi-player aspect of the game (like a real IO game). Currently this has a playground at this [link] (https://thekidofarcrania.github.io/PaperIO-Web). It's a demo version of what to come. Hopefully by that time, the necessary server infrastructure could be obtained. This is a clone of the original Paper-IO released by Voodoo, except for one aspect. This will attempt to implement a multi-player aspect of the game (like a real IO game). Currently this has a playground at this [link] (https://thekidofarcrania.github.io/PaperIO-Web). It's a demo version of what to come. Hopefully by that time, the necessary server infrastructure could be obtained.

View File

@ -49,7 +49,7 @@ function run() {
if (success) if (success)
{ {
console.info("Connected to game!"); console.info("Connected to game!");
$("#begin").css("display: none"); $("#begin").addClass("hidden");
$("#begin").animate({ $("#begin").animate({
opacity: 0 opacity: 0
}, 1000); }, 1000);
@ -215,12 +215,27 @@ function connectServer() {
dirty = true; dirty = true;
paintLoop(); paintLoop();
$("#begin").css("display: block"); //TODO: Show score stats.
$("#begin").animate({ //Show score stats.
$("#stats").removeClass("hidden");
$("#stats").animate({
opacity: .9999 opacity: .9999
}, 1000, function() { }, 3000, function() {
norun = false; showStats();
}); });
//Then fade back into the login screen.
});
}
function showStats() {
$("#begin").removeClass("hidden");
$("#begin").animate({
opacity: .9999
}, 1000, function() {
$("#stats").addClass("hidden").css("opacity", 0);
norun = false;
}); });
} }

View File

@ -1,16 +1,17 @@
{ {
"name": "paper-io", "name": "blockly-io",
"version": "0.9.0", "version": "0.9.0",
"description": "An multiplayer-IO type game (cloned)", "description": "An multiplayer-IO type game (cloned from Paper-IO)",
"main": "", "main": "",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/theKidOfArcrania/PaperIO-Web.git" "url": "git+https://github.com/theKidOfArcrania/Blockly-IO.git"
}, },
"keywords": [ "keywords": [
"Blockly-IO",
"Paper-IO", "Paper-IO",
"IO", "IO",
"Game" "Game"
@ -18,9 +19,9 @@
"author": "theKidOfArcrania", "author": "theKidOfArcrania",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://github.com/theKidOfArcrania/PaperIO-Web/issues" "url": "https://github.com/theKidOfArcrania/Blockly-IO/issues"
}, },
"homepage": "https://github.com/theKidOfArcrania/PaperIO-Web#readme", "homepage": "https://github.com/theKidOfArcrania/Blockly-IO#readme",
"dependencies": { "dependencies": {
"finalhandler": "^1.0.0", "finalhandler": "^1.0.0",
"serve-static": "^1.11.2", "serve-static": "^1.11.2",

File diff suppressed because it is too large Load Diff

View File

@ -3,15 +3,16 @@
<link href="styles.css" rel="stylesheet"> <link href="styles.css" rel="stylesheet">
<script src="jquery.min.js"></script> <script src="jquery.min.js"></script>
<script src="bundle.js"></script> <script src="bundle.js"></script>
<title>Paper.IO</title> <title>Blockly.IO</title>
</head> </head>
<body> <body>
<canvas id="main-ui"></canvas> <canvas id="main-ui"></canvas>
<div id="stats" style="opacity: 0" class="fullscreen hidden"></div>
<div id="begin" style="opacity: .99999" class="fullscreen"> <div id="begin" style="opacity: .99999" class="fullscreen">
<div class="center"> <div class="center">
<h1>Paper.IO!</h1> <h1>Blockly.IO!</h1>
<small>Todo: replace ^^^ with a picture. Work in progress.</small> <small>Todo: replace ^^^ with a picture. Work in progress.</small><br>
<small>Welcome to the paper-io private server. Notice that if you manage to get 100% you will get a prize and subsequently get kicked out.</small>
<h1>Enter your name</h1> <h1>Enter your name</h1>
<input autocomplete="off" id="name" placeholder="An awesome name!"> <input autocomplete="off" id="name" placeholder="An awesome name!">
<button type="submit">Play!</button> <button type="submit">Play!</button>
@ -20,5 +21,5 @@
</div> </div>
</div> </div>
</div> </div>
<small>Visit the open-source code on <a href="https://github.com/theKidOfArcrania/PaperIO-Web">GitHub</a>!</small>
</body> </body>

View File

@ -12,6 +12,7 @@ body, html {
#error { #error {
color: red; color: red;
} }
canvas { canvas {
position: absolute; position: absolute;
top: 0; top: 0;
@ -59,4 +60,12 @@ button:active {
.hidden { .hidden {
display: none; display: none;
}
#stats
{
background: rgb(80, 80, 80);
position: absolute;
top: 0;
left: 0;
} }

View File

@ -1,3 +1,4 @@
//TODO: rename as "blockly.io".
var hostname = process.argv[2] || "0.0.0.0"; var hostname = process.argv[2] || "0.0.0.0";
var port = parseInt(process.argv[3]) || 80; var port = parseInt(process.argv[3]) || 80;
@ -9,7 +10,6 @@ var serveStatic = require('serve-static');
var serve = serveStatic('public/', {'setHeaders': setHeaders}); var serve = serveStatic('public/', {'setHeaders': setHeaders});
function setHeaders(res, path) { function setHeaders(res, path) {
res.setHeader("Access-Control-Allow-Origin", "http://paper-io-thekidofarcrania.c9users.io:8081");
res.setHeader('Cache-Control', 'public, max-age=0'); res.setHeader('Cache-Control', 'public, max-age=0');
} }