This commit is contained in:
StevenJoeZhang 2019-01-16 13:53:31 +08:00
parent 2ea6801dcd
commit 5c72a93605
4 changed files with 12 additions and 8 deletions

View File

@ -18,7 +18,11 @@ var mimiRequestAnimationFrame = window && window.document
: function(callback) { window.setTimeout(callback, 1000 / 30) };
function run() {
client.connectGame("//" + window.location.hostname + ":8081", $("#name").val(), function(success, msg) {
var names = "Alice Bob Carol Dave Eve Francis Grace Hans Isabella Jason Kate Louis Margaret Nathan Olivia Paul Queen Richard Susan Thomas Uma Vivian Winnie Xander Yasmine Zach".split(" ");
var prefix = "Angry Baby Crazy Diligent Excited Fat Greedy Hungry Interesting Japanese Kind Little Magic Naïve Old Powerful Quiet Rich Superman THU Undefined Valuable Wifeless Xiangbuchulai Young Zombie".split(" ");
var name = $("#name").val() || [prefix[Math.floor(Math.random() * prefix.length)], names[Math.floor(Math.random() * names.length)]].join(" ");
$("#name").val(name);
client.connectGame("//" + window.location.hostname + ":8081", name, function(success, msg) {
if (success) {
$("#begin").fadeOut(1000);
$("#main-ui").fadeIn(1000);
@ -70,10 +74,10 @@ $(document).keydown(function(e) {
case 83: newHeading = 2; break; //DOWN (S)
case 37: newHeading = 3; break; //LEFT
case 65: newHeading = 3; break; //LEFT (A)
default: return; //exit handler for other keys
default: return; //Exit handler for other keys
}
client.changeHeading(newHeading);
e.preventDefault();
//e.preventDefault();
});
$(document).on("touchmove", function(e) {

View File

@ -10,7 +10,7 @@ var SATS = [192, 150, 100].map(function(val) {
});
function log(msg) {
console.log("[" + new Date() + "] " + msg);
console.log(`[${new Date()}] ${msg}`);
}
function Game(id) {

View File

@ -1,10 +1,10 @@
{
"name": "paper-io",
"name": "Paper-io",
"version": "0.0.1",
"description": "An multiplayer-IO type game (cloned from Paper-IO)",
"main": "",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"start": "node server.js"
},
"repository": {
"type": "git",

File diff suppressed because one or more lines are too long