Skip to content

H-Sofie/MaoDie-Runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MaoDie-Runner 🦖

This is an updated and modified version of the t-rex-runner game, originally extracted by wayou/t-rex-runner

Source from chromium

You can find a online version at https://H-Sofie.github.io/MaoDie-Runner/

Original demo dino

How to run it

Unfortunately it's only possible to run the code on a webserver.
You can find the exact reason

How to extract the required code

  • Clone the chromium repo
    • Chromium is a really large repo (as of now it has nearly 1 million Commits and the default branch with only the latest commits alone consumes 4GB of disk memory) so you should clone it only optimized:
    git clone --depth 1 --branch master https://chromium.googlesource.com/chromium/src
  • Check the dependencies of the neterror component html page
  • Currently the components components/neterror and components/security_interstitials are required, so let's extract them
  • Extract those dependencies (copy the directories) into a new directory

Migration

  • Clean not required stuff from the html file, e.g. i18n or not used parts of the div
  • The sounds have to be served encoded in Base64, so encode them and add them directly
  • Remove the complicated neterror.js and replace it at the end of the body with a simple <script>new Runner('.interstitial-wrapper');</script>
  • Clean up offline.js by removing external dependencies or merging them into the file
    e.g. loadTimeData is only used to determine if the game should be disabled, which we totally don't need
  • The JS-Constant <script>const HIDDEN_CLASS = 'hidden';</script> is required
  • Simplify the stylesheets into a single one and clean up not required stuff
  • Remove unnecessary images

About

This is a modified version of the Dino game that appears when Chrome is offline.

Resources

License

Stars

Watchers

Forks

Contributors