Permalink
Browse files

Initial countdown time is now configurable.

  • Loading branch information...
1 parent 7ed6f86 commit 7552995e6813b53b37bdef02aef39e45652be052 John Conomikes committed Sep 23, 2011
Showing with 14 additions and 5 deletions.
  1. +5 −2 src/html5/src/Dashboard.js
  2. +7 −0 src/html5/src/RaceControl.js
  3. +2 −3 src/html5/src/main.js
@@ -56,8 +56,11 @@ var Dashboard = cocos.nodes.Node.extend({
this.set('penaltyTime', disp);
},
- // Starts tracking time and updating the dashboard timer
- start: function () {
+ // Starts tracking time and updating the dashboard timer. Optionally set the initial countdown
+ start: function (initialCountdown) {
+ if(initialCountdown) {
+ this.set('elapsedTime', -1 * initialCountdown)
+ }
this.scheduleUpdate();
},
@@ -23,10 +23,17 @@ var RaceControl = BObject.extend({
});
RaceControl.finishLine = 3200; // Holds the z value of the finish line
+RaceControl.initialCountdown = 3000; // Initial countdown time in milliseconds
+
+// <MEDALS>
RaceControl.times = [32, 42, 68, 100, 200]; // Holds [min, gold, silver, bronze, max] times
+
+// <GlobalSpacing>
RaceControl.intermissionSpacing = 110; // Distance in meters from previous object to intermission
RaceControl.questionSpacing = 150; // Distance in meters from previous object to question
RaceControl.finishSpacing = 110; // Distance in meters after the last question to the finish line
+
+// <PenaltySettings>
RaceControl.penaltyTime = 8; // Time in seconds lost for a incorrect answer
RaceControl.penaltySpeed = -0.5; // Percentage speed LOST for an incorrect answer
View
@@ -413,12 +413,11 @@ var FluencyApp = KeyboardLayer.extend({
},
// Three second countdown before the game begins (after pressing the start button on the menu layer)
- // TODO: Make countdown configurable
// TODO: Make countdown more noticible
countdown: function () {
- this.get('dash').start();
+ this.get('dash').start(RC.initialCountdown / 1000);
this.get('dash').bindTo('speed', this.get('player'), 'zVelocity');
- setTimeout(this.startGame.bind(this), 3000);
+ setTimeout(this.startGame.bind(this), RC.initialCountdown);
this.get('audioMixer').playSound('bg');
},

0 comments on commit 7552995

Please sign in to comment.