Introducing 'PDF Tris', a browser-based PDF viewer that lets you play Tetris
Web browsers such as Chrome and Firefox have built-in PDF viewers, so you can view PDF files without using a dedicated viewer. Now, ' PDFTris ' has been released, which allows you to play Tetris using this built-in PDF viewer in your browser.
pdftris.pdf
(PDF file)
Click 'Start game' to play.
By clicking the buttons in the red frame with the mouse, you can move, rotate, and drop the tetriminos. However, it is quite difficult to play.
If you want to operate with the keyboard, click 'Type here for keyboard controls' at the bottom. Then you can move, rotate, and fall the tetriminos with the WASD keys. In addition, since the tetriminos do not rotate when inputting in Japanese, it is necessary to switch to half-width alphanumeric input.
When you use the WASD keys to control the tetriminos, the key input you press to operate them is accumulated in the red frame of the screen.
You can check out how it's actually played in the video below. When you actually play it, it's a completely normal Tetris game, except for the following points: 'The next falling tetrimino is not displayed,' 'The time you can move after the tetrimino has fallen is short,' and 'There are cases where the same tetrimino falls three or four times in a row.'
When you actually play 'PDF Tris' which allows you to play Tetris with a PDF viewer in your browser, it looks like this - YouTube
PDF Tris was developed by Thomas Rinsma , a principal security analyst at security software developer Codean . He explained the development of PDF Tris in Hacker News, 'I noticed that the PDF engines in modern desktop browsers ( PDFium and PDF.js ) support JavaScript with enough I / O primitives to create a basic game like Tetris. It was a bit difficult to find a combination of features that worked in both engines, but in the end, I found that the display / hiding of annotation 'fields' worked well to create monochrome pixels, and typing in a text input box allowed keyboard input. Overall it's pretty clumsy, but it's a good reminder of how versatile PDF scripting is.'
The source code for PDFTris is also available on GitHub.
GitHub - ThomasRinsma/pdftris
https://github.com/ThomasRinsma/pdftris
Related Posts: