This file contains 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 API_URL = "http://deckofcardsapi.com/api"; | |
var API_PROXY = "https://jsonp.afeld.me/?url="; | |
var game; | |
startGame(); | |
// to start off the game, make a new game object (with attributes that will preserve the game's state, ie, who has what cards) and then | |
// ask the API for a deck ID to assign to the game object's deck (we need to use it for subsequent calls to the API, when we ask it for cards from | |
// our deck). | |
// We can't do anything until we have that deck ID, but the program would happily continue on prior to actually loading the object that contains the |
This file contains 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
// this will look better if you change the page's CSS to: | |
// .hide { | |
// visibility: hidden; } | |
function randomSeconds() { | |
return 10000 * Math.random(); | |
} | |
function setRespawns() { | |
var hiddenlinks = [].slice.call(document.querySelectorAll(".hide")); |