added rush helper functions

This commit is contained in:
lengstrom 2014-08-24 12:12:41 -04:00
parent 968bc54dce
commit e544503ab0
3 changed files with 11 additions and 2 deletions

View file

@ -20,6 +20,7 @@ function hidebottombar() {
}
function initialize(a) {
window.rush = 1;
window.lastTime = Date.now();
window.iframHasLoaded = false;
window.colors = ["#e74c3c", "#f1c40f", "#3498db", "#2ecc71"];

View file

@ -168,3 +168,11 @@ function handleClickTap(x,y) {
MainHex.rotate(-1);
}
}
function setRush() {
rush = 2;
}
function removeRush() {
rush = 1;
}

View file

@ -207,7 +207,7 @@ function animLoop() {
requestAnimFrame(animLoop);
render();
var now = Date.now();
var dt = (now - lastTime)/16.666;
var dt = (now - lastTime)/16.666 * rush;
if(gameState == 1 ){
if(!MainHex.delay) {
@ -255,7 +255,7 @@ function animLoop() {
case 2:
var now = Date.now();
var dt = (now - lastTime)/16.666;
var dt = (now - lastTime)/16.666 * rush;
requestAnimFrame(animLoop);
update(dt);
render();