src/games/RunBabyRun/RunBabyRun.js
// Resets game variables and layouts but does not start the game (game starts on keypress)
Resets game variables and layouts but does not start the game (game starts on keypress)
Resets game variables and layouts but does not start the game ( game starts on keypress )
function resetGame() {
    phase = "waiting";
    lastTimestamp = undefined;
    sceneOffset = 0;
    curScore=0;
    introductionElement.style.opacity = 1;
    perfectElement.style.opacity = 0;
    restartButton.style.display = "none";
    platforms = [{ x: 50, w: 50 }];
    generatePlatform();
    generatePlatform();
    generatePlatform();
    generatePlatform();
    sticks = [{ x: platforms[0].x + platforms[0].w, length: 0, rotation: 0 }];
    trees = [];
    generateTree();
    generateTree();
    generateTree();
    generateTree();
    generateTree();
    generateTree();
    generateTree();
    generateTree();
    generateTree();
    generateTree();
    heroX = platforms[0].x + platforms[0].w - heroDistanceFromEdge;
    heroY = 0;
    draw();
  }
function resetGame ( ) { phase = "waiting" ; lastTimestamp = undefined ; sceneOffset = 0 ; curScore = 0 ; introductionElement . style . opacity = 1 ; perfectElement . style . opacity = 0 ; restartButton . style . display = "none" ; platforms = [ { x : 50 , w : 50 } ] ; generatePlatform ( ) ; generatePlatform ( ) ; generatePlatform ( ) ; generatePlatform ( ) ; sticks = [ { x : platforms [ 0 ] . x + platforms [ 0 ] . w , length : 0 , rotation : 0 } ] ; trees = [ ] ; generateTree ( ) ; generateTree ( ) ; generateTree ( ) ; generateTree ( ) ; generateTree ( ) ; generateTree ( ) ; generateTree ( ) ; generateTree ( ) ; generateTree ( ) ; generateTree ( ) ; heroX = platforms [ 0 ] . x + platforms [ 0 ] . w - heroDistanceFromEdge ; heroY = 0 ; draw ( ) ; }
Resets game variables and layouts but does not start the game (game starts on keypress)
Resets game variables and layouts but does not start the game ( game starts on keypress )
// Reset game progress // The first platform is always the same // x + w has to match paddingX