fade in on restart

This commit is contained in:
Garrett Finucane 2014-05-30 21:05:01 -04:00
parent b51a73481d
commit 8cb927920c
4 changed files with 5 additions and 3 deletions

View file

@ -62,7 +62,7 @@ keypress.register_combo({
keypress.register_combo({
keys: "enter",
on_keydown: function() {
if (gameState != 1 && gameState != -2) {
if ( gameState != -2) {
init();
}
}

View file

@ -136,6 +136,8 @@ function init() {
score = saveState.score || 0;
prevScore = 0;
spawnLane = 0;
op=0;
scoreOpacity=0;
gameState = -2;
if(saveState.clock !== undefined) gameState = 1;

View file

@ -1,5 +1,5 @@
var grey = '#bdc3c7';
var op=0;
op=0;
var saveState = localStorage.getItem("saveState") || "{}";
if(saveState !== "{}"){op=1;}
function render() {

View file

@ -26,7 +26,7 @@ function renderText(x, y, fontSize, color, text) {
ctx.fillText(text, x, y + (fontSize / 4) + 3.5);
}
var scoreOpacity = 0;
scoreOpacity = 0;
function drawScoreboard() {
if(scoreOpacity < 1){
scoreOpacity+=0.01;