Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Commit

Permalink
Simplify spawnObjs count init from query string.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Humphrey committed Sep 7, 2011
1 parent 8765eed commit ed25581
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/rescuefox.js
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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];

Expand Down

0 comments on commit ed25581

Please sign in to comment.