Experimental browser for the Atmosphere
Doodling some ECSish things with #Svelte integration. Thread for a little context.
May 1, 2025, 11:17 AM
{ "uri": "at://did:plc:gdgssnismf7rsf5you3ndgmm/app.bsky.feed.post/3lo46qjszfc2u", "cid": "bafyreicwhznjnm62peon4dg7254choalt7vb77wxtp6e4t4wt4blfcvy6e", "value": { "text": "Doodling some ECSish things with #Svelte integration. Thread for a little context.", "$type": "app.bsky.feed.post", "embed": { "$type": "app.bsky.embed.images", "images": [ { "alt": "<script lang=\"ts\">\n\timport { Entity, Trait, World, System } from '$lib/necs-svelte';\n\timport { trait } from '$lib/toybox/necs';\n\n\tconst Position = trait((x: number = 0, y: number = 0) => ({ x, y }));\n\tconst Velocity = trait((x: number = 0, y: number = 0) => ({ x, y }));\n</script>\n\n<World>\n\t<Entity traits={[Position(), Velocity(1, 2)]} />\n\n\t<Entity>\n\t\t<Trait trait={Position(10, 10)} />\n\t\t<Trait trait={Velocity(0, -9.81)} />\n\t</Entity>\n\n\t<System\n\t\tupdate={(dt, world) => {\n\t\t\tfor (const [e, pos, vel] of world.query(Position, Velocity)) {\n\t\t\t\tpos.x += vel.x * dt;\n\t\t\t\tpos.y += vel.y * dt;\n\t\t\t}\n\t\t}}\n\t/>\n</World>\n", "image": { "$type": "blob", "ref": { "$link": "bafkreibickus2dihk2wkujmcurorz2x7jgw7ag63k53w5enq3buhkicr4y" }, "mimeType": "image/jpeg", "size": 428933 }, "aspectRatio": { "width": 1402, "height": 1122 } } ] }, "langs": [ "en" ], "facets": [ { "index": { "byteEnd": 40, "byteStart": 33 }, "features": [ { "tag": "Svelte", "$type": "app.bsky.richtext.facet#tag" } ] } ], "createdAt": "2025-05-01T11:17:14.094Z" } }