{"id":20461171,"url":"https://github.com/moroboxai/moroxel8ai","last_synced_at":"2026-04-02T03:11:37.465Z","repository":{"id":37719819,"uuid":"504775697","full_name":"moroboxai/moroxel8ai","owner":"moroboxai","description":"Fantasy 8-bit CPU for MoroboxAI","archived":false,"fork":false,"pushed_at":"2023-10-17T16:57:45.000Z","size":5187,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-26T10:51:31.195Z","etag":null,"topics":["8-bit","8-bit-cpu","cpu","fantasy-console","javascript","lua","moroboxai","pixijs","typescript"],"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/moroboxai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-06-18T07:29:59.000Z","updated_at":"2023-04-11T15:49:59.000Z","dependencies_parsed_at":"2023-10-16T06:33:47.450Z","dependency_job_id":"76ce13de-46e8-4ea3-b3f0-e788bfe43f3d","html_url":"https://github.com/moroboxai/moroxel8ai","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/moroboxai/moroxel8ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moroboxai%2Fmoroxel8ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moroboxai%2Fmoroxel8ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moroboxai%2Fmoroxel8ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moroboxai%2Fmoroxel8ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moroboxai","download_url":"https://codeload.github.com/moroboxai/moroxel8ai/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moroboxai%2Fmoroxel8ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"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":["8-bit","8-bit-cpu","cpu","fantasy-console","javascript","lua","moroboxai","pixijs","typescript"],"created_at":"2024-11-15T12:23:53.188Z","updated_at":"2026-04-02T03:11:37.443Z","avatar_url":"https://github.com/moroboxai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# moroxel8ai\n\n[![NPM version](https://img.shields.io/npm/v/moroxel8ai.svg)](https://www.npmjs.com/package/moroxel8ai)\n![Node.js CI](https://github.com/moroboxai/moroxel8ai/workflows/Node.js%20CI/badge.svg)\n[![gitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/moroboxai/moroxel8ai/blob/master/LICENSE)\n[![Code Quality: Javascript](https://img.shields.io/lgtm/grade/javascript/g/moroboxai/moroxel8ai.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/moroboxai/moroxel8ai/context:javascript)\n[![Total Alerts](https://img.shields.io/lgtm/alerts/g/moroboxai/moroxel8ai.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/moroboxai/moroxel8ai/alerts)\n\nFantasy 8-bit CPU for [MoroboxAI](https://github.com/moroboxai).\n\n## Why\n\nMoroboxAI by itself is a generic framework that can run any JavaScript code that exports a **boot** function.\n\nMoroxel8AI is a layer of abstraction on top of that and:\n  * Uses [PixiJS](https://pixijs.com/) as a renderer\n  * Uses [fengari](https://github.com/fengari-lua/fengari) for running your game written in Lua\n  * Implements all the boilerplate for being compatible with MoroboxAI\n  * Takes care of loading all your assets\n  * Provides a simple interface for controlling the graphics, audio, and inputs\n\nTo sum up, Moroxel8AI takes care of all the boilerplate required for initializing and running your game in MoroboxAI, and lets you focus on coding the game logic in Lua.\n\n## Minimal game\n\nFor the purpose of this tutorial, we will create a `sample` folder with the following structure:\n\n```bash\nsample/\n├─ assets/\n│  ├─ tilemap.png\n├─ game.lua\n├─ header.yml\n├─ index.html\n```\n\nThe `assets` directory is where Moroxel8AI will load assets from. Here is `tilemap.png`, this is a 16x16 pixels tilemap taken from Mario on NES:\n\n![Preview](https://github.com/moroboxai/moroxel8ai/raw/media/tilemap.png)\n\nThe `header.json` contains some metadata about assets and how to run the game:\n\n```yml\nassets:\n    - name: tilemap\n      path: tilemap.png\nboot: Moroxel8AI\nmain: game.lua\n```\n\nAll the game logic is written in `game.lua`:\n\n```lua\n-- select tilemap.png as the tilemap\nlocal tilemap = tmap('tilemap')\n-- set the size of one tile to 16x16 pixels\ntmode(16)\n-- assign the tile (0, 3) to sprite\nstile(tilemap, 0, 3, 1, 1)\n-- set the origin to center\nsorigin(8, 8)\n\nlocal angle = 0\n\nfunction tick(deltaTime)\n    -- clear screen\n    clear()\n    -- rotate sprite\n    angle = angle + deltaTime\n    srot(angle)\n    -- draw sprite on screen\n    sdraw(SWIDTH / 2, SHEIGHT / 2)\nend\n```\n\nNow, all remain is `index.html` which is simply loading MoroboxAI + Moroxel8AI and initializing the game:\n\n```html\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003ctitle\u003emoroxel8ai\u003c/title\u003e\n        \u003cscript type=\"text/javascript\" src=\"https://cdn.jsdelivr.net/npm/moroboxai-player-web@latest/lib/umd/moroboxai-player-web.min.js\"\u003e\u003c/script\u003e\n        \u003cscript type=\"text/javascript\" src=\"https://cdn.jsdelivr.net/npm/moroxel8ai@latest/lib/umd/moroxel8ai.min.js\"\u003e\u003c/script\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003cdiv id=\"player\"\u003e\u003c/div\u003e\n    \u003c/body\u003e\n    \u003cscript type=\"text/javascript\"\u003e\n        (function() {\n            console.log(`moroboxai-player-web v${MoroboxAIPlayer.VERSION}`);\n            \n            player = MoroboxAIPlayer.init(document.getElementById(\"player\"), {\n                url: `./`,\n                resizable: false,\n                autoPlay: true,\n                onReady: () =\u003e console.log(\"ready\")\n            });\n        })();\n    \u003c/script\u003e\n\n    \u003cstyle type=\"text/css\"\u003e\n        body {\n            height: 100%;\n            margin: 0;\n            padding: 0;\n            display: flex;\n            flex-direction: column;\n            align-items: center;\n            justify-content: center;\n        }\n\n        #player {\n            background-color: black;\n            background-size: cover;\n            width: 256px;\n            height: 256px;\n        }\n    \u003c/style\u003e\n\u003c/html\u003e\n```\n\n## Run on the web\n\nTesting on the web requires you to run a local HTTP server to avoid CORS errors when loading local files.\n\nFor that you can install **http-server**:\n\n```bash\nnpm install http-server -g\n```\n\nOpen a command prompt in the `moroxel8ai` folder and run:\n\n```bash\nhttp-server\n```\n\nNow you can access the page on **localhost** and the port opened by **http-server**.\n\n## License\n\nThis content is released under the [MIT](http://opensource.org/licenses/MIT) License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoroboxai%2Fmoroxel8ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoroboxai%2Fmoroxel8ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoroboxai%2Fmoroxel8ai/lists"}