logo80lv
Articlesclick_arrow
Research
Talentsclick_arrow
Events
Workshops
Aboutclick_arrow
profile_loginLogIn

You Can Now Run DOOM In A PDF File

Play it in your browser.

It's a well-known fact: if it has a screen, DOOM can be played on it. Pregnancy testsBlender's Geometry NodesWindows' NotepadLEGO bricksa hacking conference attendee badge, quantum computers, the list continues endlessly, with no limits to the developers' creativity. But what about text?

There's another kind of competition in the PDF file format world, and this time, GitHub user Ading2210 has successfully combined the classic first-person shooter with the document format, allowing you to play it in Chromium-based browsers that use the PDFium engine.

Ading2210

Ading2210

The PDF file format supports JavaScript through its own separate standard library, which is implemented by modern browsers like Chromium and Firefox as part of their PDF engines. However, the APIs available in the browser environment are significantly more limited. 

Apparently, older versions of Emscripten can compile C code to asm.js, which runs smoothly within the constrained JavaScript runtime of the PDF engine. Ading2210 used the doomgeneric fork of the original DOOM source for this project, as it simplified the process of handling input/output, and all they had to do was implement a framebuffer and keyboard inputs.

As the developer explained, unlike previous interactive PDF demos, DoomPDF achieves its output by creating a text field for each row of pixels on the screen and setting their contents to various ASCII characters. This approach results in a 6-color monochrome display that can be updated at a reasonably quick rate of 80ms per frame.

Play DoomPDF here and check out the source code on GitHub. Ading2210 is a talented high school student with a passion for programming who previously shared another fun project, running the Bad Apple!! music video on the GitHub Contributions Graph:

Don't forget to join our 80 Level Talent platform and our new Discord server, follow us on InstagramTwitterLinkedInTelegramTikTok, and Threads, where we share breakdowns, the latest news, awesome artworks, and more.

Join discussion

Comments 0

    You might also like

    We need your consent

    We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more