Created
January 24, 2016 15:58
-
-
Save AphonicChaos/ee6dd41e3820cdd5628d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gameInProgress = [ | |
{ | |
aspidites: turn("NorthWest"), | |
davidg_: move("Forward") | |
}, | |
{ | |
aspidites: shoot(), | |
davidg_: turn(east) | |
} | |
]; | |
function turn(bearing) { | |
return { | |
"action": "turn", | |
"direction": bearing | |
} | |
} | |
function shoot() { | |
returh { | |
"action": "shoot" | |
} | |
} | |
function move(direction) { | |
return { | |
"action": "move" | |
"direction": direction | |
} | |
} | |
function runGame(turns) { | |
$.get({ | |
url: "http://localhost:8001/playTurn" | |
method: "GET" | |
data: turns | |
}); | |
} | |
$(document).ready(function(){ | |
runGame(gameInProgress); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment