📄 You can now play Tetris in a PDF File.

[Thomas Rinsma], a security analyst and hobbyist tinkerer, recently figured out how to create a version of Tetris that runs inside a PDF file. He tackled the project “just for fun” after learning the potential implementations of PDF’s JavaScript API. The result is a novel version [Rinsma] calls PDFTRIS.

https://github.com/ThomasRinsma/pdftris

#pdf #tetris #pdftris #gaming #engineer #artist #media #javascript #programming #art #tech #news

Thomas Rinsma decided to abuse PDF field objects to render monochrome grid, and combine it with keystroke-entry in a text field to receive inputs – that’s how #PDFTris, a playable Tetris in a PDF file was born.

https://gamedevjs.com/games/pdftris-play-tetris-in-a-pdf/

#gamedev #gamedevjs #pdf #tetris #pdfjs

PDFTris – play Tetris in a PDF - Gamedev.js

Thomas Rinsma decided to abuse PDF field objects to render monochrome grid, and combine it with keystroke-entry in a text field to receive inputs - that's how playable Tetris in a PDF file was born. You can read the blog post about the implementation details from the author himself - the display part is quite

Gamedev.js - Web Game Development community
PDF瀏覽器內玩遊戲 PDFTris突破創意界限
網頁瀏覽器內置的 PDF 檢視器,如 Chrome 和 Firefox,現已成為一款極具創意的遊戲平台。由 T […]
The post PDF瀏覽器內玩遊戲 PDFTris突破創意界限 appeared first on 香港 unwire.hk 玩生活.樂科技.
#遊戲情報 #PDFTris
https://unwire.hk/2025/01/11/pdftris/game-channel/?utm_source=rss&utm_medium=rss&utm_campaign=pdftris
PDF瀏覽器內玩遊戲 PDFTris突破創意界限

網頁瀏覽器內置的 PDF 檢視器,如 Chrome 和 Firefox,現已成為一款極具創意的遊戲平台。由 Thomas Rinsma 開發的「PDFTris」讓用戶可透過 PDF 檢視器體驗經典遊戲「俄羅斯方塊」(Tetris),展示了 PDF 技術應用的全新可能。PDFTris 的 PDF 檔案可於官方網站下載,並直接在內置 PDF 檢視器中運行。開啟後,點擊「Start game」即可開始遊戲,玩家需透過滑鼠點擊 PDF 文件內的紅框按鈕控制方塊移動、旋轉及下落。若想透過鍵盤進行操作,用戶需點擊「Type here for keyboard controls」啟用鍵盤模式,並以 WASD 鍵操控方塊。然而,為保證正常操作,需將輸入法切換至半角英數模式,否則無法進行旋轉。雖然整體體驗接近普通的 Tetris,但 PDFTris 仍有一些特點和限制需注意:遊戲不會顯示下個即將掉落的方塊,且方塊著地後可移動時間較短。此外,部分情況下,連續出現相同形狀方塊的機率較高。操作時,按下的鍵盤輸入會即時顯示於紅框區域,增加趣味性。 PDFTris 開發者 Thomas Rinsma 為 Codean 的資深安全分析師,他指出現代桌面瀏覽器內的 PDFium 與 PDF.js 引擎已支援 JavaScript,具備開發基本遊戲所需的輸入/輸出功能。經過技術整合,遊戲利用注釋欄位的顯示與隱藏模擬像素,並透過文本輸入框實現鍵盤操作。Rinsma 表示:「PDFTris 雖然整體操作略顯笨拙,但這是一個強而有力的示例,展示了 PDF 腳本的靈活性及其多功能應用範圍。」

香港 unwire.hk 玩生活.樂科技