Before Entering, You May Need To Add A Bookmark To Your Browser.

Content Of The Bookmark:

javascript:config %3D %7B%0A%09%27updateInterval%27 %3A 33%2C%0A%09%27autoRestart%27 %3A false%2C%0A%09%27restartTimeout%27 %3A 1000%2C%0A%09%27intergateArduino%27 %3A false%0A%7D%3B%0A%0AlittleDinoLoaded %3D false%3B%0A%0Afunction loadLittleDino() %7B%0A%0A%09if(!littleDinoLoaded) %7B%0A%09%09runner %3D Runner.instance_%3B%0A%09%09tRex %3D runner.tRex%3B%0A%09%09littleDinoLoaded %3D true%3B%0A%09%09document.getElementById(%27main-message%27).children%5B0%5D.innerHTML %2B%3D %27 XD%27%3B%0A%09%7D%0A%0A%09if(!runner.running) %7B%0A%09%09lastBlink %3D %7B%7D%3B%0A%09%09updateIntervalId %3D setInterval(updateLittleDino%2C config.updateInterval)%3B%0A%09%09runner.restart()%3B%09%0A%09%7D%0A%7D%0A%0Afunction updateLittleDino() %7B%0A%0A%09%2F%2FCheck if T-Rex is still running (not dead)%0A%09if(!runner.isRunning()) %7B%0A%09%09%2F%2FDead%2C stop calling updateLittleDino%0A%09%09clearInterval(updateIntervalId)%3B%0A%0A%09%09if(config.autoRestart) %7B%0A%09%09%09%2F%2FRestart after config.restartTimeout milliseconds%0A%09%09 %09setTimeout(function() %7B%0A%09%09 %09%09loadLittleDino()%3B%0A%09%09 %09%7D%2C config.restartTimeout)%3B%0A%09%09%7D%0A%0A%09%7D else if(runner.isRunning()) %7B%0A%0A%09%09%2F%2FCheck if it just reached another 100 score%0A%09%09var distance %3D runner.distanceMeter.getActualDistance(runner.distanceRan)%3B%0A%09%09if (distance > 0 %26%26 distance %25 runner.distanceMeter.config.ACHIEVEMENT_DISTANCE %3D%3D 0 %26%26 config.intergateArduino) %7B%0A%09%09%09blinkLED(%27C%27%2C 500)%3B%0A%09%09%7D%0A%0A%09%09%2F%2FIf obstacles isn%27t created%2C do nothing. This happens when game just started%0A%09%09if(!runner.horizon.obstacles %7C%7C runner.horizon.obstacles.length %3D%3D 0) return%3B%0A%0A%09%09if(!tRex.jumping) %7B%0A%09%09%09%2F%2FT-Rex is running on the ground%0A%0A%09%09%09%2F%2FStart checking if T-Rex should duck%0A%09%09%09var firstObstacle %3D runner.horizon.obstacles%5B0%5D%3B %09%09%0A%0A%09%09%09var shouldDuck %3D firstObstacle.yPos %2B firstObstacle.typeConfig.height < 150 - 25%3B%0A%0A%09%09%09if((shouldDuck %26%26 !tRex.ducking) %7C%7C (!shouldDuck %26%26 tRex.ducking)) %7B%0A%09%09%09%09tRex.setDuck(shouldDuck)%3B%0A%09%09%09%7D%0A%0A%09%09%09%2F%2FBlink LED if T-Rex is ducking%0A%09%09%09if(shouldDuck %26%26 config.intergateArduino) blinkLED(%27B%27%2C 300)%3B%0A%0A%09%09%09%2F%2FDon%27t have to jump if T-Rex should duck%0A%09%09%09if(shouldDuck) return%3B%0A%0A%0A%09%09%09%2F%2FStart checking if T-Rex should jump%0A%09%09%09%2F%2FGet obstacle first that is at right side of T-Rex%0A%09%09%09var obstacle %3D null%0A%09%09%09for(var i %3D 0%3B i < runner.horizon.obstacles.length%3B i%2B%2B) %7B%0A%09%09%09%09if(runner.horizon.obstacles%5Bi%5D.xPos >%3D tRex.xPos %2B tRex.config.WIDTH) %7B%0A%09%09%09%09%09obstacle %3D runner.horizon.obstacles%5Bi%5D%3B%0A%09%09%09%09%09break%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%0A%09%09%09if(!obstacle) return%3B%0A%09%09%09%0A%09%09%09%2F%2FCheck if the obstacle is gonna touch T-Rex%0A%09%09%09if(tRex.yPos < obstacle.yPos %2B obstacle.typeConfig.height %26%26 %0A%09%09%09%09tRex.config.HEIGHT %2B tRex.yPos > obstacle.yPos) %7B%0A%09%09%09%0A%09%09%09%09var jumpFactor %3D (obstacle.xPos %2B obstacle.typeConfig.width %2B obstacle.typeConfig.height) %2F runner.currentSpeed%3B%0A%0A%09%09%09 %09if(jumpFactor <%3D 30 %26%26 !tRex.jumping) %7B%0A%0A%09%09%09 %09%09runner.playSound(runner.soundFx.BUTTON_PRESS)%3B%0A%09%09%09 %09%09runner.tRex.startJump(runner.currentSpeed)%3B%0A%0A%09%09%09 %09%09if(config.intergateArduino) blinkLED(%27A%27%2C 300)%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%0A%09%09%7D else %7B%0A%09%09%09%2F%2FT-Rex is jumping%0A%09%09%09%2F%2FIf T-Rex already jumped over the first obstacle%2C speed drop%0A%09%09%09if(runner.horizon.obstacles.length > 0) %7B%0A%09%09%09%09var obstacle %3D runner.horizon.obstacles%5B0%5D%3B%0A%09%09%09%09if(tRex.xPos > obstacle.xPos %2B obstacle.typeConfig.width %26%26 !tRex.speedDrop) %7B%0A%09%09%09%09%09tRex.setSpeedDrop()%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%7D%0A%0Afunction blinkLED(led%2C time) %7B%0A%0A%09var currentTimestamp %3D new Date().getTime()%3B%0A%0A%09if(lastBlink%5Bled%5D %26%26 currentTimestamp - lastBlink%5Bled%5D <%3D time) return%3B%0A%0A%09lastBlink%5Bled%5D %3D currentTimestamp%3B%0A%0A%09var request %3D new XMLHttpRequest()%3B%0A%09request.open(%27GET%27%2C %27http%3A%2F%2F127.0.0.1%3A81%2FblinkLED%3FLED%3D%27 %2B led %2B %27%26time%3D%27 %2B time)%3B%0A%09request.send()%3B%0A%7D%0A%0A%2F%2FBind loadLittleDino to space%2C up keydown events%0Adocument.addEventListener(%27keydown%27%2C function(event) %7B%0A%09if(event.keyCode %3D%3D 32 %7C%7C event.keyCode %3D%3D 38) %7B%0A%09%09loadLittleDino()%3B%0A%09%7D%0A%7D%2C false)%3B%0A%2F%2FBind loadLittleDino to mouse click events%0Adocument.addEventListener(%27mouseup%27%2C function(event) %7B%0A%09if(Runner.instance_ %26%26 Runner.instance_.isLeftClickOnCanvas(event)) %7B%0A%09%09loadLittleDino()%3B%0A%09%7D%0A%7D%2C false)%3B

If You Can Not Understand, Go Back.

Click Here To Return Back

Press The Bookmark Before Starting The Game.

Start The Game