{"id":51069348,"url":"https://github.com/skywardpixel/platformer-primitives","last_synced_at":"2026-06-23T09:30:50.473Z","repository":{"id":361086831,"uuid":"1253018425","full_name":"skywardpixel/platformer-primitives","owner":"skywardpixel","description":"Simple, well-commented Love2D examples of Metroidvania building blocks: character controller, camera, parallax, and room transitions.","archived":false,"fork":false,"pushed_at":"2026-05-29T05:33:18.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-29T07:26:34.043Z","etag":null,"topics":["gamedev","love2d","lua","metroidvania","pixel-art","platformer"],"latest_commit_sha":null,"homepage":null,"language":"Lua","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/skywardpixel.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-29T04:49:38.000Z","updated_at":"2026-05-29T05:33:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/skywardpixel/platformer-primitives","commit_stats":null,"previous_names":["skywardpixel/platformer-primitives"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/skywardpixel/platformer-primitives","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywardpixel%2Fplatformer-primitives","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywardpixel%2Fplatformer-primitives/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywardpixel%2Fplatformer-primitives/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywardpixel%2Fplatformer-primitives/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skywardpixel","download_url":"https://codeload.github.com/skywardpixel/platformer-primitives/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywardpixel%2Fplatformer-primitives/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34684671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"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":["gamedev","love2d","lua","metroidvania","pixel-art","platformer"],"created_at":"2026-06-23T09:30:46.123Z","updated_at":"2026-06-23T09:30:50.459Z","avatar_url":"https://github.com/skywardpixel.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Platformer Primitives\n\nA small collection of **Love2D** examples covering the core building blocks of a\n2D Metroidvania. Each primitive is a focused, heavily-commented example you can\nread top-to-bottom and lift into your own project.\n\n| # | Example | What it teaches |\n|---|---------|-----------------|\n| 1 | **Character Controller** | Run with acceleration/friction, gravity with capped fall speed, variable-height jump, **coyote time**, **jump buffering**, one-way platforms. |\n| 2 | **Camera Controller** | Smooth follow camera with a **dead-zone**, **look-ahead**, zoom, and **level-bounds clamping** — with a live overlay that visualises all of it. |\n| 3 | **Parallax Background** | Multiple background layers scrolling at different speeds to fake depth, tiled to repeat forever. |\n| 4 | **Map / Room Transition** | Metroidvania room changes: an **edge slide** when you walk off the side, and a **door fade-warp**. |\n\nAll art is real pixel-art PNG (in `assets/`), generated by a script — see below.\n\n## Running\n\nYou need [Love2D](https://love2d.org/) **11.x** installed.\n\n```sh\nlove .\n```\n\nThen pick an example from the menu (`Up`/`Down` + `Enter`, or press `1`–`4`).\nPress `Esc` to return to the menu, `H` to toggle the on-screen help/controls.\n\n### Controls (in any example)\n\n- **Move:** Arrow keys or `A`/`D`\n- **Jump:** `Space` / `Z` / `Up` (hold for a higher jump)\n- **Drop through a one-way platform:** hold `Down` + jump\n- **R:** reset position\n- Each example lists its extra keys in the on-screen help panel.\n\n## Project layout\n\n```\nmain.lua                 -- menu + scene switcher, routes input to examples\nconf.lua                 -- window config (960x540, internal art is 480x270)\nlib/\n  assets.lua             -- image cache (nearest-neighbour filtering)\n  anim.lua               -- sprite-sheet animation helper\n  camera.lua             -- the follow camera (used by examples 1-4)\n  tilemap.lua            -- tile storage, culled rendering, AABB collision\n  player.lua             -- the character controller (used by examples 1-4)\n  level.lua              -- small grid builder for describing levels in code\nexamples/\n  character_controller.lua\n  camera_controller.lua\n  parallax_background.lua\n  map_transition.lua\nassets/                  -- generated PNGs\ntools/\n  gen_assets.py          -- regenerates the art (Pillow)\n```\n\nThe shared `lib/` modules are the reusable parts; the files in `examples/` are\nthe thin, readable demos that wire them together.\n\n## Where the \"feel\" lives\n\nThe character controller's tuning knobs are all at the top of\n[`lib/player.lua`](lib/player.lua) (`TUNING`): gravity, run speed, acceleration,\njump strength, coyote time, jump buffer, etc. Tweak those numbers to change how\nthe character feels.\n\nThe camera's tuning (`smooth`, `deadzoneW/H`, `lookAheadDist`) lives at the top\nof [`lib/camera.lua`](lib/camera.lua) — and example 2 lets you change several of\nthem live with the keyboard.\n\n## Regenerating the art\n\nThe PNGs in `assets/` are produced by `tools/gen_assets.py` using\n[Pillow](https://python-pillow.org/). You only need this if you want to change\nthe art:\n\n```sh\npython3 -m venv .venv\n.venv/bin/pip install Pillow\n.venv/bin/python tools/gen_assets.py\n```\n\n## Dev smoke test\n\n`main.lua` has a built-in self-test that runs every example through a few\nhundred frames (with simulated input + forced transitions) and quits:\n\n```sh\nlove . --test            # run every example headlessly, report errors\nlove . --shots           # same, but also save screenshots to the save dir\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskywardpixel%2Fplatformer-primitives","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskywardpixel%2Fplatformer-primitives","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskywardpixel%2Fplatformer-primitives/lists"}