minor edits of previous commits
This commit is contained in:
parent
ca249361b6
commit
d9be46986e
@ -65,11 +65,11 @@ function serverTransfer(coordinate,team,turn,username) {
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
contentType: 'application/json;charset=UTF-8'
|
contentType: 'application/json;charset=UTF-8'
|
||||||
})
|
})
|
||||||
// Receiving Data
|
// Server Response
|
||||||
.then(
|
.then(
|
||||||
function success(data) {
|
function success(data) {
|
||||||
for (var user in data) {
|
for (var user in data) {
|
||||||
} if (data.hasOwnProperty(user) && (user != username)) {
|
if (data.hasOwnProperty(user) && (user != username)) {
|
||||||
console.log(data[user][turn]);
|
console.log(data[user][turn]);
|
||||||
var theMove = data[user][turn];
|
var theMove = data[user][turn];
|
||||||
updateTable(theMove[1], theMove[2]);
|
updateTable(theMove[1], theMove[2]);
|
||||||
@ -199,18 +199,15 @@ function movePlayer(e) {
|
|||||||
type = "up";
|
type = "up";
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
movement(0,-1);
|
movement(0,-1);
|
||||||
} else
|
} else if (e.keyCode === 40 && type != "down") {
|
||||||
if(e.keyCode === 40 && type != "down") {
|
|
||||||
type = "down";
|
type = "down";
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
movement(0,1);
|
movement(0,1);
|
||||||
} else
|
} else if (e.keyCode === 37 && type != "left") {
|
||||||
if(e.keyCode === 37 && type != "left") {
|
|
||||||
type = "left"
|
type = "left"
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
movement(-1,0);
|
movement(-1,0);
|
||||||
} else
|
} else if (e.keyCode === 39 && type != "right") {
|
||||||
if(e.keyCode === 39 && type != "right") {
|
|
||||||
type = "right"
|
type = "right"
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
movement(1,0);
|
movement(1,0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user