Lurker News
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://github.com/ThomasRinsma/pdftris/blob/main/gengrid.py

Comments (223) 81 threads

Show all comments

Showing thread 74 of 81

Fernicia2 replies#
Back in school pdfs would circulate that had a bunch of flash games on them. I have no idea how or who made them, but they let us play dolphin olympics on lab computers with no internet connection.
doublerabbit1 reply#
Excel for games and PowerPoint for stick animations. You'd spend hours in CAD class just creating PowerPoint animations and not doing any CAD.

I regret this decision now and wish that I had paid some attention. 3D printers are cool and I have no idea how to design objects for it.

phkahler1 reply#
>> I do wish I did pay some attention to CAD now. I want a 3D printer and have no idea how to design objects for it.

Get Solvespace: https://solvespace.com/index.pl
Do the tutorials. If/when you outgrow it, the concepts will carry over to FreeCAD which otherwise has a steeper learning curve but has more capabilities.

smj-edison1 reply#
An aside, but I found FreeCAD to be a real pain. The dependency tracking across sketches is really quite horrid. If I have sketch2 linked to sketch1, and I delete a line in sketch1, it will arbitrarily reassign all the sketch2->sketch1 dependencies. Maybe they fixed that since I've used it, but I've transferred over to Onshape for all my hobby stuff...

EDIT: looks like they finally addressed the topological naming problem, I guess I better give it a second chance!

Continue this thread — 1 reply

pbhjpbhj1 reply#
I'm not sure, but I think it may have been that Adobe Viewer (or whatever it was) could run Flash?
Someone#
Maybe, but PDF can contain Flash Applets, too.

However, modern version of Acrobat Reader do not support that anymore. https://helpx.adobe.com/acrobat/kb/flash-format-support-in-p...:
“Flash Player end-of-life (EOL) impacts playback and authoring of rich media having Flash content (.flv and .swf) in PDFs:
• Playback of Flash media (.flv and .swf) content in existing PDFs will not be supported.”