{"id":15418022,"url":"https://github.com/pelikhan/arcade-pico8","last_synced_at":"2025-04-19T14:39:58.254Z","repository":{"id":125489887,"uuid":"173501597","full_name":"pelikhan/arcade-pico8","owner":"pelikhan","description":"Compat layer for pico8 tweetcarts in MakeCode Arcade","archived":false,"fork":false,"pushed_at":"2020-04-04T13:27:22.000Z","size":1076,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T08:43:42.621Z","etag":null,"topics":["arcade","makecode"],"latest_commit_sha":null,"homepage":"https://pelikhan.github.io/arcade-pico8/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pelikhan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-03-02T21:37:41.000Z","updated_at":"2024-04-09T09:44:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"61f6d7e1-3bb8-45bf-a02d-e0a6404f6b44","html_url":"https://github.com/pelikhan/arcade-pico8","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"7926e28ed74a45590bdac616fe55cddac8c56f2d"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelikhan%2Farcade-pico8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelikhan%2Farcade-pico8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelikhan%2Farcade-pico8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pelikhan%2Farcade-pico8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pelikhan","download_url":"https://codeload.github.com/pelikhan/arcade-pico8/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249716223,"owners_count":21315062,"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","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":["arcade","makecode"],"created_at":"2024-10-01T17:19:01.171Z","updated_at":"2025-04-19T14:39:58.221Z","avatar_url":"https://github.com/pelikhan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\n\n---\n\n# arcade-pico8 [![Build Status](https://travis-ci.org/pelikhan/arcade-pico8.svg?branch=master)](https://travis-ci.org/pelikhan/arcade-pico8)\n\nA tiny compatibility layer to port the amazing Pico-8 #Tweetcarts\nto https://arcade.makecode.com .\n\n## APIs\n\n## Examples\n\n* https://twitter.com/lucatron_/status/1096168653735657472\n\n```typescript\nconst c = [0, 1, 2, 8, 14, 15, 7]\nfillp(0xa5a5)\nconst r = range(3, 68, .1);\npaint(function () {\n    for (let w of r) {\n        const a = 4 / w + time() / 4;\n        const k = 145 / w;\n        const x = 64 + cos(a) * k;\n        const y = 64 + sin(a) * k;\n        const i = 35 / w + 2 + time() * 3;\n        rect(x - w, y - w, x + w, y + w, f(i) * 16 + f(i + .5));\n    }\n})\nfunction f(i: number) {\n    return c[flr(1.5 + abs(6 - i % 12))]\n}\n```\n\n* https://twitter.com/guerragames/status/1099766885120425987\n\n```typescript\nconst s = sin;\nconst c = cos;\nlet t = 0;\nconst ir = range(-48, 48, 3);\nconst jr = range(-48, 48, 3);\npaint(function () {\n    t += 0.05;\n    rectfill(16, 16, 112, 112, 2)\n    for (const i of ir) {\n        for (const j of jr) {\n            const n = i / 64;\n            const m = j / 64;\n            const x = s(t / 3) * i / 48 * c(n + t / 5) + c(m + t / 2) * s(n + t / 5);\n            const y = s(t / 4) * j / 32 * c(n + t / 7) + s(m + t / 3) * s(n + t / 7);\n            const d = sqrt(x * x + y * y);\n            circ(64 + i, 64 + j, 4 * d, 8 + d * 1.5)\n        }\n    }\n})\n```\n\n* https://twitter.com/jordi_ros/status/1099803248192569344\n\n```typescript\nfunction z(x: number, y: number, j: number, i: number) {\n    const o = time() * .03 + j\n    return max(-1, 7 - sqrt((11 - x - sin(o * i) * 6) ^ 2 + (11 - y + cos(o * j) * 6) ^ 2))\n}\n\npaint(function () {\n    for (let y = 0; y \u003c= 23; ++y) {\n        for (let x = 0; x \u003c= 23; ++x) {\n            let v = z(x, y, 7.1, 3.2) + z(x, y, 2.7, -5.3) + z(x, y, -3.5, 4.3)\n            v = min(v, 5.8 - v)\n            circfill(x * 6, y * 6, v * 2, 8 + v)\n        }\n    }\n});\n```\n\n* https://twitter.com/guerragames/status/1099800737377382400\n\n```typescript\nlet t = 0;\nconst ir = range(-45, 45, 3);\nconst jr = range(-45, 45, 3);\npaint(function () {\n    t += .02\n    for (let i of ir) {\n        for (let j of jr) {\n            const n = i / 64\n            const m = j / 64\n            const a = 7 * atan2(n, m)\n            const x = i / 32 + sin(t + a)\n            const y = j / 32 + cos(t + a)\n            const d = 2 * sqrt(x * x + y * y)\n            circ(64 + i, 64 + j, 2 * d, 8 + d)\n        }\n    }\n});\n```\n\n* https://twitter.com/StegmayerLuke/status/1099072015649001473\n\n```typescript\nconst t: { x: number; y: number; z: number }[] = [];\nconst n = 64\nfor (let i of range(-32, n))\n    t.push({ x: i, y: 0, z: 0 });\n\nconst ir = range(1, n);\npaint(function () {\n    for (const i of ir) {\n        const q = t[i];\n        //let [x, y] = p(q.x, q.y, q.z)\n        let arr = p(q.x, q.y, q.z)\n        let x = arr[0];\n        let y = arr[1];\n        q.z += 1\n        //let [a, b] = p(q.x, q.y, q.z)\n        arr = p(q.x, q.y, q.z)\n        let a = arr[0];\n        let b = arr[1];\n        line(x, y, a, b);\n        if (q.z \u003e -2) {\n            q.y = -rnd(n) + 32\n            q.z = -rnd(n) - 2\n        }\n    }\n});\nfunction p(x: number, y: number, z: number): number[] {\n    return [-x / z * n + n, -y / z * n + n];\n}\n```\n\n* https://twitter.com/jordi_ros/status/1099472557810634754\n\n```typescript\nconst yr = range(0, 23);\nconst ir = range(0, 2);\npaint(function () {\n    for (let y of yr) {\n        for (let x of yr) {\n            let v = -2;\n            for (let i of ir) {\n                const p = time() - i * 1.5;\n                const r = p % 2;\n                const n = flr(p / 2);\n                const c = 1 - sqrt(((n * 137) % 22 - x) ^ 2 +\n                    ((n * 53) % 22 - y) ^ 2) + r * 15 + v * 0.8;\n                v = max(min(c, 8 - c), v);\n            }\n            circfill(x * 6, y * 6, v * 1.3, 8 + v * 0.6)\n        }\n    }\n})\n```\n\n* https://twitter.com/platformalist/status/1096854118935584768\n\n```typescript\nconst p: { x: number; y: number; v: number; q: number; }[] = [];\nfor (let j of range(0, 23)) {\n    for (let i of range(1, 24)) {\n        p.push({ x: j * 4 + 22, y: i * 4 + 18, v: i / 12, q: j / 12 });\n    }\n}\n\nscene.setBackgroundColor(7);\npaint(function () {\n    for (const k of p) {\n        if (k.v \u003c 3) k.v += .04; else k.v = -3;\n        if (k.q \u003c 3) k.q += .04; else k.q = -3;\n        k.x += sin(k.q) / 2\n        k.y += sin(k.v) / 2\n        pset(k.x, k.y, 0)\n    }\n    rect(p[0].x, p[0].y, p[p.length - 1].x, p[p.length - 1].y, 0)\n})\n```\n\n* https://twitter.com/fernandojsg/status/1101471040188964864\n\n```typescript\npoke(0x5F2C, 3);\nlet f: number[] = [];\nlet p = [0, 1, 2, 4, 8, 9, 10, 7]\nlet left = 0;\nlet top = 80;\nlet w = 160;\nlet h = 60;\nlet d = w * h;\nfunction s(t: number) {\n    const e = f[t];\n    const i = flr(rnd(3));\n    f[t - i + 1 - w] = e - band(i, 1)\n}\nfor (let i = 0; i \u003c= d; ++i) {\n    f[i] = (i \u003e d - w) ? 8 : 0;\n}\n\npaint(function () {\n    for (let x = 0; x \u003c= w; ++x) {\n        for (let y = 0; y \u003c= h - 1; ++y) {\n            s(y * w + x)\n        }\n    }\n    for (let x = 0; x \u003c= d; ++x) {\n        pset(left + x % w, top + flr(x / w), p[f[x]])\n    }\n})\n```\n\n* https://twitter.com/fernandojsg/status/1101800243216244737\n\n```typescript\n// https://twitter.com/fernandojsg/status/1101800243216244737\nlet p: { x: number; y: number; a: number; b: number; }[] = []\nlet n = 48\nlet w = 160\nconst r = rnd;\nfor (let i = 0; i \u003c= n; ++i) {\n    p[i] = {\n        x: r(w),\n        y: r(w),\n        a: r(2) - 1,\n        b: r(2) - 1\n    }\n}\npaint(function () {\n    for (let i = 0; i \u003c= n; ++i) {\n        let a = p[i];\n        let u = a.x;\n        let v = a.y;\n        a.x = (u + a.a) % w;\n        a.y = (v + a.b) % w;\n        for (let j = i; j \u003c= n; ++j) {\n            let b = p[j];\n            let x = u - b.x;\n            let y = v - b.y;\n            let d = sqrt(x * x + y * y)\n            if (d \u003c 20) {\n                line(u, v, b.x, b.y, d \u003c 13 ? 12 : 1)\n            }\n        }\n        circ(u, v, 1, 7)\n    }\n})\n```\n\n## License\n\nMIT\n\n## Supported targets\n\n* for PXT/arcade\n(The metadata above is needed for package search.)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpelikhan%2Farcade-pico8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpelikhan%2Farcade-pico8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpelikhan%2Farcade-pico8/lists"}