{"id":35190353,"url":"https://github.com/abagames/peekpoke","last_synced_at":"2025-12-29T05:38:28.713Z","repository":{"id":178188657,"uuid":"640404681","full_name":"abagames/peekpoke","owner":"abagames","description":"Tiny minimal retro fantasy console having only two commands: peek and poke.","archived":false,"fork":false,"pushed_at":"2025-06-29T01:35:27.000Z","size":624,"stargazers_count":35,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-04T08:19:12.654Z","etag":null,"topics":["fantasy-console","game-development"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abagames.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-14T01:13:35.000Z","updated_at":"2025-08-17T21:13:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8831df7-73bb-4278-a4f6-9e1ec535372b","html_url":"https://github.com/abagames/peekpoke","commit_stats":null,"previous_names":["abagames/peekpoke"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/abagames/peekpoke","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abagames%2Fpeekpoke","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abagames%2Fpeekpoke/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abagames%2Fpeekpoke/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abagames%2Fpeekpoke/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abagames","download_url":"https://codeload.github.com/abagames/peekpoke/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abagames%2Fpeekpoke/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28111190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-29T02:00:07.021Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fantasy-console","game-development"],"created_at":"2025-12-29T05:38:22.119Z","updated_at":"2025-12-29T05:38:28.705Z","avatar_url":"https://github.com/abagames.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PEEKPOKE\n\nTiny minimum retro fantasy console having only two commands: peek and poke.\n\n## Sample game 'BOMB SNAKE'\n\n[![BOMB SNAKE](https://raw.githubusercontent.com/abagames/peekpoke/main/docs/screenshot.gif)](https://abagames.github.io/peekpoke/bombsnake/)\n\nGames for PEEKPOKE can be written in [simple JavaScript code](https://github.com/abagames/peekpoke/blob/main/docs/bombsnake/main.js). PEEKPOKE games [run in the browser](https://abagames.github.io/peekpoke/bombsnake/) of any PC or mobile device.\n\n## Memory map\n\n![memory_map](https://raw.githubusercontent.com/abagames/peekpoke/main/docs/memorymap.png)\n\nYou can draw pixels or text by writing a number to a specific address in memory (poke), or get the input status of a key by reading a number from the address (peek).\n\n## Getting started\n\nDownload [docs/getting_started/index.html](https://raw.githubusercontent.com/abagames/peekpoke/main/docs/getting_started/index.html) and write your game code in the `\u003cscript\u003e` element. Open `index.html` in a browser and play the game.\n\n## Use with npm\n\n```\n% npm i peekpoke\n```\n\nThe peekpoke library must be imported and initialized.\n\n```JavaScript\nimport \"peekpoke\";\ninitPeekpoke({ setup, loop, enableSplashScreen: false });\n\nfunction setup() { ... }\n\nfunction loop() { ... }\n```\n\n## Sample snippets\n\n### Draw a pixel\n\n```JavaScript\n// Draw a red pixel at (x, y).\npoke(ADDRESS_VIDEO + x + y * VIDEO_WIDTH, COLOR_RED);\n```\n\n### Draw a text\n\n```JavaScript\n// Draw a 'A' text at (x, y).\npoke(ADDRESS_TEXT + x + y * TEXT_WIDTH, \"A\".charCodeAt(0));\n```\n\n### Set text color\n\n```JavaScript\n// Make the text color green.\npoke(ADDRESS_TEXT_COLOR + x + y * TEXT_WIDTH, COLOR_GREEN);\n```\n\n### Set text background color\n\n```JavaScript\n// Make the text background color blue.\npoke(ADDRESS_TEXT_BACKGROUND + x + y * TEXT_WIDTH, COLOR_BLUE);\n```\n\n### Check keystroke state\n\n```JavaScript\n// Check if the up key is pressed.\nif (peek(ADDRESS_KEY + KEY_UP) \u0026 KEY_STATE_IS_PRESSED) ...\n// Check if the left key is just pressed.\nif (peek(ADDRESS_KEY + KEY_LEFT) \u0026 KEY_STATE_IS_JUST_PRESSED) ...\n// Check if the X key is just released.\nif (peek(ADDRESS_KEY + KEY_X) \u0026 KEY_STATE_IS_JUST_RELEASED) ...\n```\n\n### Buzzer\n\n```JavaScript\n// Buzzer at 500 (50 x 10) Hz.\npoke(ADDRESS_BUZZER, 50);\n// Stop buzzer.\npoke(ADDRESS_BUZZER, 0);\n```\n\n## Other sample games\n\nClick on the image to play the game.\n\n\u003ca href=\"https://abagames.github.io/peekpoke/dashracket/\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/abagames/peekpoke/main/docs/dashracket/screenshot.gif\" width=\"25%\" loading=\"lazy\"\u003e\u003c/a\u003e\u003ca href=\"https://abagames.github.io/peekpoke/beebees/\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/abagames/peekpoke/main/docs/beebees/screenshot.gif\" width=\"25%\" loading=\"lazy\"\u003e\u003c/a\u003e\u003ca href=\"https://abagames.github.io/peekpoke/laserlaser/\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/abagames/peekpoke/main/docs/laserlaser/screenshot.gif\" width=\"25%\" loading=\"lazy\"\u003e\u003ca href=\"https://abagames.github.io/peekpoke/banebox/\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/abagames/peekpoke/main/docs/banebox/screenshot.gif\" width=\"25%\" loading=\"lazy\"\u003e\u003c/a\u003e\n\nThe source code is located in [the docs directory](https://github.com/abagames/peekpoke/tree/main/docs). See `main.js` in the directory for each game.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabagames%2Fpeekpoke","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabagames%2Fpeekpoke","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabagames%2Fpeekpoke/lists"}