Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
HTML Kong (xn--8ws00zhy3a.com)
209 points by spicytunacone on Oct 8, 2016 | hide | past | favorite | 30 comments


The game logic is held within the CSS, which has a rather beautiful obfuscation/formatting applied: http://kong.xn--8ws00zhy3a.com/kong.css


Check out what happens if you disable the CSS. In Firefox: Tools / Web Developer / Style Editor / Toggle style sheet visibility (the little eye icon).


Any idea how to do it?


Author here. It was done with a Python script that parses the CSS into a stream of characters annotated with metadata saying whether the character is allowed to be escaped and whether whitespace can be inserted before or after it. It's then just a matter of breaking up the stream where whitespace is permitted and using the escaping to pad segments to the exact size required.

Definitely not recommended in production. Other than the obvious inefficiency, it was only supported in Chrome fairly recently (even though the CSS escaping rules have remained largely unchanged for 20 years or so). In this case, though, the game itself depended on recent bug fixes in Chrome, so there wasn't much point in worrying about compatibility with older versions.


Remove all the whitespace, and then add spaces and newlines in legal positions to make the wave pattern.

Edit: It also seems to add escapes to the text to make it a bit neater than what I suggested.


I want to know this too. Must be some grunt/gulp script.


It makes transferring the CSS less efficient, so probably not to be recommended.


I think I played this IRL.

It would be nice to be able to use the keyboard to play, clicking the screen with the mouse is too difficult (I don't have a touchscreen.)


Bear in mind that the whole point of this exercise was to produce a game without using any JavaScript whatsoever. It was intended to be more of a technology demonstration than a playable game. As the article pointed out, you can find a much more accurate and playable implementation of the game on the Pica Pic website. http://pica-pic.com/


Love it! But yes, needs keyboard support.


I was just reminded these ever existed 9 hours ago by Crash Course Games: https://youtu.be/ZEwbHWspFWY?t=2m35s


Yeah, the flash version they link too has keyboard support and is much more playable for it!


Side note for hn devs, this url is in Chinese characters but appears as garbage in hn site.



That explains that it's not 'garbage' but it doesn't explain why hn isn't doing something a bit nicer than hosing the Unicode version. As another commenter pointed out, even just displaying both would probably be an improvement.


I get the feeling HN needs something of a rewrite for better Unicode support in general, based solely on the ways I've seen it strip Unicode from comments.


I can only speak to the parts I know about.


I also believe that a something better than the status quo is possible. Perhaps render the URL correctly then display the obfuscated URL beside it in between parentheses.

International domain names will never be used if browser and website support remains as horrible as it currently is.


Sadly, that's just the RFC at work.


At first I thought it didn't work for me neither in Firefox 49.0 nor Chromium 51.0 on Fedora 23.

One has to first press one of the "GAME A" or "GAME B" buttons, and then press the "JUMP" button.


Dam I loved that game as a child!

(Game A / Game B was how you started the game on the original)


I remembered after all those years. Reminds me of school coach trips.


Related: Horrible PDF experiments (play breakout in a PDF document)

https://github.com/osnr/horrifying-pdf-experiments


It works on my phone (in Chrome for Android) too!


Doesn't work on latest Safari. I'm sad how hopeless it become...


Huh? Safari is the only browser I ever use. Apart from these super-experimental sites that occasionally show up on HN, the entire web works just fine.


Super experimental means features that Chrome, Firefox AND Edge supported for years?


I'm not a web developer, I don't know the details, I only know that when I'm browsing normal regular web pages, Safari is awesome and seems to use far less power than any other browser.


Not supporting Safari is just laziness most of the time.


Safari is the new IE.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: