From ed25581cd157aa16a1e4dec89a5f54e231a498fa Mon Sep 17 00:00:00 2001 From: David Humphrey Date: Wed, 7 Sep 2011 15:40:43 -0400 Subject: [PATCH] Simplify spawnObjs count init from query string. --- src/rescuefox.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/rescuefox.js b/src/rescuefox.js index 6dc9c26..ce5c270 100644 --- a/src/rescuefox.js +++ b/src/rescuefox.js @@ -6,10 +6,10 @@ var engine = options.engine; var CubicVR = engine.graphics.CubicVR; - var spawnObjs = 100; - var cameraOffset = [ 0, 2, 4 ]; + // Specify a different number of asteroids via index.html?# on the url, or use default + var spawnObjs = (window.location.search.substr(1) | 0) || 100; - function isNaN(n) { return n!=n; } + var cameraOffset = [ 0, 2, 4 ]; var generateObjects = function() { var result = []; @@ -94,11 +94,6 @@ var nobjs = objlist.length-1; - var b = window.location.search.substr(1) | 0; - if (b && !isNaN(b)) { - spawnObjs = b; - } - for (var i = 0; i < spawnObjs; i++) { var src = objlist[i%nobjs+1];