Loading Cookies...
Foumart Games Blog
JS13K Games 2019 pt.1 - Image Encryptor

JS13K games is Javascript golfing competition that runs for a month between August 13th and September 13th every year. The game jam has one main characteristic - the entire game (source code, graphics, sounds etc.) must be contained in a 13 kilobytes ZIP archive, as constrained by the creator of the compo Andrzej Mazur (@end3r).
Why 13 kB you may ask? End3r once explained that he liked the js1k and java4k gamedev contests and the front-end challenges where participants had to build a website in 10k, but he imagined a larger file size limit and more relaxed timeframe. In order to differentiate and stand out, the original 13k limit was chosen with "bad luck" as first theme, 13th August as start date and a whole month of competition time.

My participation in the Compo over time

JS13K first took place in 2012 and at that time there were a total of 61 submissions. I'm participating for the fourth time in a row now - the competition has been more popular lately, with around 250 submissions in the last three editions of the compo. I wrote an article about the Lightweight JavaScript Libraries prepared beforehand and along my first entry "Skip'n Glitch", which I submitted in 2016. One of the classes included there is a 900 bytes Tweener used for animation, timed callbacks and various DOM manipulations. My first three submissions were non real-time games and the tweener came handy for them as I used a lot of DOM elements. The game that stood with unique mechanic was my 2017 submission "Formation Absent". In my latest submission "Super Bunny Strikes Back!" I relied on HTML5 Canvas and went for old school platformer with high FPS demand. Each year I'm trying to increase the quality and complexity of my entries, I also tried to incorporate this year's theme "Back" in greater depth.. but more about that later. Here are my compo submissions:
Skip'n Glitch Formation Absent, 2017 Storm of the Chaos Bane Super Bunny Strikes Back!
The 13 312 bytes limit

The file size limit may sound pretty tight considering that even a tiny image can occupy dozens of kilobytes, but it's actually enough to compress quite a large chunk of text, i.e. Javascript code. Depending on the code density you can pack from 32kB up to 128kB of Javascript. There are a lot of tricks you can use in order to save space. For 2D games image spritesheets must be compressed with tools like TinyPNG, or Compress-Or-Die... On the other hand I have seen participants using extensively CSS techniques, or the SVG vector format, not to mention that every year there are more and more 3D games utilizing advanced webGL techniques. I prefer to compact the game in a single index.html file, cutting the multiple file overhead. If you have multiple files they can increase your archive file size by a lot. Images can be in-lined as Base62 encoded strings, but for the purpose of the JS13K compo, I believe there is a more optimized way of storing the image data.

Image Encryptor

For my latest two entries I use 8 colored (3-bit) images. They are stored as text strings, encoded in a way not using special ASCII characters. This makes the data suitable for archiving. The method for storing was invented by one of the jam participants - @xem. I extended his miniPixelArt tool and made it possible to load image files:

Note: Flash Player plugin and Pop-up functionality must be allowed before using the tool


In Super Bunny Strikes Back I have two playable main characters and they comprise significant portion of the sprites used in the game. I knew there won't be much space and decided not to cut from their 6-frame jumping animations, but rather reduce the enemy creatures count and diverse them with different color pallets (changing colors is quite trivial if you use the Image Encryptor).

Super Bunny Strikes Back! Super Bunny Strikes Back!

The sprites have 7 colors and transparency. In addition I use a special approach to mimic a contour by applying a drop shadow filter on all images. This comes with a bit of limitation on what can be drawn with the sprites - for example you can't place two pixels of contour vertically next to each other. But with a little effort this can be walked around with suitable pixel art.

Super Bunny Strikes Back! Super Bunny Strikes Back! Super Bunny Strikes Back!

To be continued...


The Puzzle of Life was created during Castle Game Jam 2018 by Noncho Savov (me, programming) and Jurgita Raynite (art). The Game Jam was organized by James Newnorth (Spelkollektivet) and was held in a medieval castle located in Örebro, Sweden between the 7th and 15th of July. The main theme of the jam was "Capricious"...

Read more


My upcoming rogue-like role playing game RogueVerse Dungeon was showcased at Retrospelsmässan - one of the largest retro game conventions in the world! The convention is held every year in Gothenburg Sweden and I presented my game as part of Spelkollektivet exhibition. It was an amazing experience - I managed to collect a great portion of feedback from attendees of all ages.. and it was incredible to see a little girl beating my game:..

Read more


Check out my new game Formation Absent - a turn-based tactical puzzle, which is easy to win but hard to master. A game that is only 13 kilobytes, submission in JS13K competition. Theme of the competition this year is "Lost". As per Compo rules the game is contained in 13kb archive and includes 13 stages and a level editor. The game also keeps your game progress and score through utilizing URL vars. Here is an example of the gameplay:..

Read more


Each year, a unique JavaScript game development competition takes place within one month, starting on August 13th, named JS13KGames. What's interesting about this competition is that there is a filesize limit requirement on the submitted game source - the entire game must be packed in 13kB ZIP archive. In 2016, I participated with Skip'n Glitch, a two player competitive logical game involving strategy and arithmetics. The game has a single player mode set against a simple and predictable but challenging AI opponent. Two players can play against each other on the same device...

Read more


As the web tech is evolving, the flash player for web browsers is getting more and more obsolete. For example the biggest advertising platform - Google's DoubleClick dropped support for flash ads. I'm not speaking against the flash technology, which is still viable for game development (it can be easily compiled for mobile or wrapped into Steam). However in web there are new heroes and one of them is the HTML Canvas. I've already shared some lightweight JavaScript libraries used in #js13kgames and today I'm sharing another class - Lens Flare effect!..

Read more


When creating a flash game for the web it's crucial to know the domain the game SWF is being loaded from. There are numerous ways to embed a SWF in a website and the different methods of obtaining the domain name at run-time are giving different values. For example a game could be hosted in sourcedomain.com but displayed in a web page at another domain, say hotlinkingdomain.com. In this case there is one method to obtain the domain that is hosting the SWF and other methods of obtaining the domain that is embedding (hot linking) that SWF...

Read more


As I was digging around the allowNetworking setting and how the SWF can determine it at runtime, I decided to go deeper and catch other types of embedding restrictions, like the allowScriptAccess parameter. I've seen sites that block outgoing links of certain flash files - in most cases flash games are prevented to access the web, resulting in negative effect over their authors - the game developers...

Read more


Atrakt 4096 is minimalist mixture between Sci-Fi action and a sliding puzzle. Vanquish all alien spawns in this level based game, involving not only exploring and fighting but planning, stealth, strategy and logical thinking as well! This game was developed in Flash-AS3 and is an extension of my Attract 4kb engine which consists of 4 kilobytes of code (4 classes)...

Read more


DisplaceR is a lightweight Displacement Map Filter Tweener targeting Flash Player 9. Written in ActionScript 3.0¹², DisplaceR is built with the idea to be as simple as possible, becoming accessible by all kind of flash developers and designers. Being a static class makes it available anywhere in your project. Tweening is achieved only with one line of code...

Read more


Born in 4kb Games on FlashGameLicense competition. A game that is exactly 4096 bytes :) It's featuring Artificial Intelligence, Fog of War, Player Health, 4 Maps and 12 Levels ! Developed in ActionScript 3 for Flash Player 9. Here is a Github link where you can view the optimized code...

Read more

FoumartGames.com Copyright
© 2008-2019 by Noncho Savov
All rights reserved. Privacy Policy.