Show HN: Tetris in a PDF
972 by ThomasRinsma | 176 comments
I realized that the PDF engines of modern desktop browsers (PDFium and PDF.js) support JavaScript with enough I/O primitives to make a basic game like Tetris. It was a bit tricky to find a union of features that work in both engines, but in the end it turns out that showing/hiding annotation "fields" works well to make monochrome pixels, and keyboard input can be achieved by typing in a text input box. All in all it's quite janky but a nice reminder of how general purpose PDF scripting can be. The linked PDF is all ASCII so you can just open it in a text editor, or have a look at the source code here: https://ift.tt/EsGZ6tI
Subscribe to:
Post Comments (Atom)
JOB JUNCTIONHigh Court of Gujarat Peon Waiting List 2025
MaruGujarat.in High Court of Gujarat Peon Waiting List 2025: Waiting List for Peon Declared by High Court of Gujarat from MaruGujarat.i...
-
Boards are dangerous to founder/CEOs 574 by tosh | 264 comments
-
Stepping Back from Speaking 502 by alfredbez | 124 comments
-
વડાપ્રધાન નરેન્દ્ર મોદી લાલ કિલ્લા પરથી પગાર વધારો અને રિટાયર મેન્ટની વયમર્યાદા વધારવાની from Top Stories News - Gujarat Samachar : World...
No comments:
Post a Comment