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.

View File

@ -49,7 +49,7 @@ function run() {
if (success)
{
console.info("Connected to game!");
$("#begin").css("display: none");
$("#begin").addClass("hidden");
$("#begin").animate({
opacity: 0
}, 1000);
@ -215,13 +215,28 @@ function connectServer() {
dirty = true;
paintLoop();
$("#begin").css("display: block");
//TODO: Show score stats.
//Show score stats.
$("#stats").removeClass("hidden");
$("#stats").animate({
opacity: .9999
}, 3000, function() {
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;
});
});
}
function processFrame(data)

View File

@ -1,16 +1,17 @@
{
"name": "paper-io",
"name": "blockly-io",
"version": "0.9.0",
"description": "An multiplayer-IO type game (cloned)",
"description": "An multiplayer-IO type game (cloned from Paper-IO)",
"main": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/theKidOfArcrania/PaperIO-Web.git"
"url": "git+https://github.com/theKidOfArcrania/Blockly-IO.git"
},
"keywords": [
"Blockly-IO",
"Paper-IO",
"IO",
"Game"
@ -18,9 +19,9 @@
"author": "theKidOfArcrania",
"license": "MIT",
"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": {
"finalhandler": "^1.0.0",
"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">
<script src="jquery.min.js"></script>
<script src="bundle.js"></script>
<title>Paper.IO</title>
<title>Blockly.IO</title>
</head>
<body>
<canvas id="main-ui"></canvas>
<div id="stats" style="opacity: 0" class="fullscreen hidden"></div>
<div id="begin" style="opacity: .99999" class="fullscreen">
<div class="center">
<h1>Paper.IO!</h1>
<small>Todo: replace ^^^ with a picture. Work in progress.</small>
<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>Blockly.IO!</h1>
<small>Todo: replace ^^^ with a picture. Work in progress.</small><br>
<h1>Enter your name</h1>
<input autocomplete="off" id="name" placeholder="An awesome name!">
<button type="submit">Play!</button>
@ -20,5 +21,5 @@
</div>
</div>
</div>
<small>Visit the open-source code on <a href="https://github.com/theKidOfArcrania/PaperIO-Web">GitHub</a>!</small>
</body>

View File

@ -12,6 +12,7 @@ body, html {
#error {
color: red;
}
canvas {
position: absolute;
top: 0;
@ -60,3 +61,11 @@ button:active {
.hidden {
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 port = parseInt(process.argv[3]) || 80;
@ -9,7 +10,6 @@ var serveStatic = require('serve-static');
var serve = serveStatic('public/', {'setHeaders': setHeaders});
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');
}