NewsCrawler.org

Playload, a 3KB JavaScript game engine that embeds a whole game in a URL

Playload, a 3KB JavaScript game engine that embeds a whole game in a URL
PlayloadのエディタとダンジョンゲームGlyph Quest
Shooterを別タブで遊ぶ
Jumpを別タブで遊ぶ
Image: qiita.com

The developer of Pyxel released Playload, an open-source JavaScript game engine capped at 3KB after compression (3,000 bytes). It renders 160×144 pixels in 8 colors with a CRT[1] effect, includes built-in 8×8 dot images for characters, symbols and Unicode emoji, plays three-channel music compatible with the ZX Spectrum 128[2] PLAY command, takes 4-direction and 2-button input, and exposes an API of 6 functions, 2 variables and 1 callback. The limit comes from X, which shortens URLs of up to 4,096 characters to 23: after subtracting the base URL and the growth introduced by Base64[3] encoding, about 3,000 bytes remain, enough to carry a whole game in the URL payload[4], which gives the engine its name. Official samples — an Invaders-style shooter at 2.34KB, a jump action game at 1.76KB and a Lights Out puzzle at 1.35KB — all fit under the cap, and stage layouts are written as strings with emoji such as 👾 and 💎. Editing, running, saving and sharing happen in the browser: the code doubles as the URL, so milestones can be saved as bookmarks, and users have already released frenchbread's Dungeon Escape, a first-person dungeon exploration with BGM, and haruka_apps's megademo “rubble.”

Read the original qiita.com

Sources

  • Qiita JA

    3KBしか使えない!奇妙で素敵なゲームエンジン「Playload」のご紹介

    95 likes45 saves1 commentReactions: 0

Published: First seen: Читать по-русски

Open as a page