📜 ⬆️ ⬇️

JavaScript Embedding and Encoding

Note: Below is the translation of the article “Embedding and Encoding in JavaScript” , in which the author (a JavaScript evangelist in Mozilla and the author of the jQuery library in combination) examines ways of compressing information and combining it with JavaScript and some other methods. My comments further in italics.

A rough implementation in JavaScript ( note on Habré , link blog.nihilogic.dk/2008/04/super-mario-in-14kb-javascript.html ) of the first level Super Mario Brothers just recently went around the whole Internet. It is generally possible to play it, although many key aspects are missed (no mushrooms, no flag, no boost points, etc.). However, this is actually not the most interesting aspect in this game.

Probably the most interesting thing in this web application is not the game mechanics itself, but the fact that everything is collected in one single file - a game script that includes all game sprites and all the music.
')
This is a very interesting pattern of engineering, and it contains things that you can apply in your own code. Let's move on and analyze how it was done so that we could use all these tricks for our own sites.

read further on webo.in → .

Source: https://habr.com/ru/post/31558/


All Articles