margin:0; padding:0; white-space:nowrap; overflow:hidden; }
.gridShowCoords table.grid td:hover { color:rgba(255,255,255,0.1); }
-#viewport { position:relative; width:500px; height:500px; margin:1em auto; /* overflow:hidden; */ }
+#viewport { position:relative; width:500px; height:500px; margin:1em auto; cursor:crosshair; }
#overlay { position:fixed; top:0; left:0; width:100%; height:100%; background-color:#000; opacity:0.5; z-index:100; }
// -*- mode: JavaScript; tab-width: 4; indent-tabs-mode: nil; -*-
tanks.config = {
+ debug : {
+ gridShowCoords : false
+ },
pathing : {
overlayPathmap : false,
overlayAIPaths : false,
traceTrajectories : false
- },
- debug : {
- gridShowCoords : false
-
}
};
\ No newline at end of file
init : function init(viewport){
Y.bindAll(this);
+ tanks.resetGlobals();
+
this.byId = {};
this.active = new Y.YArray();
this.units = new Y.YArray();
;
+tanks.resetGlobals = function resetGlobals(){
+ NOW = new Date().getTime();
+ ELAPSED = MS_PER_FRAME;
+ TICKS = 0;
+
+ SECONDTH = ELAPSED / 1000;
+ SQUARETH = REF_SIZE * SECONDTH;
+}
+
if (!window.console) {
console = {
log : Y.op.nop,
// Main method is only executed once, so we'll setup things
// that don't change between games.
function main(){
- qkv = Y(window.location.search).fromKV();
+ qkv = Y(window.location.search.slice(1)).fromKV().end();
/// Debug ///
if (qkv.debug) $('#debug').toggle();