Skip to content

Instantly share code, notes, and snippets.

@AphonicChaos
Created January 24, 2016 15:58
Show Gist options
  • Save AphonicChaos/ee6dd41e3820cdd5628d to your computer and use it in GitHub Desktop.
Save AphonicChaos/ee6dd41e3820cdd5628d to your computer and use it in GitHub Desktop.
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