{"id":18000368,"url":"https://github.com/dinubs/lucid","last_synced_at":"2025-03-26T07:32:08.169Z","repository":{"id":36126876,"uuid":"115109382","full_name":"dinubs/lucid","owner":"dinubs","description":"2D Javascript platforming engine","archived":false,"fork":false,"pushed_at":"2023-01-05T00:50:44.000Z","size":607,"stargazers_count":12,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T11:22:27.240Z","etag":null,"topics":["game-engine","javascript","platformer"],"latest_commit_sha":null,"homepage":"https://lucid.dinubs.now.sh","language":"JavaScript","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/dinubs.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}},"created_at":"2017-12-22T11:28:10.000Z","updated_at":"2023-03-25T11:15:51.000Z","dependencies_parsed_at":"2023-01-16T23:31:01.167Z","dependency_job_id":null,"html_url":"https://github.com/dinubs/lucid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinubs%2Flucid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinubs%2Flucid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinubs%2Flucid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinubs%2Flucid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinubs","download_url":"https://codeload.github.com/dinubs/lucid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245611823,"owners_count":20643903,"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":["game-engine","javascript","platformer"],"created_at":"2024-10-29T23:11:34.988Z","updated_at":"2025-03-26T07:32:07.634Z","avatar_url":"https://github.com/dinubs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lucid\n\nLucid is a 2D Javascript game-engine, primarily for the platforming genre. Heavily based on the game-engine Dissimulate posted on both [GitHub](https://github.com/dissimulate/Clarity) and [CodePen](https://codepen.io/dissimulate/pen/CqIxk) name Clarity. It's quite evolved from that engine, as things are much more broken apart now, and easier to extend on. The benefit of a lightweight engine like Lucid is to get a playable version as fast as possible that you can build upon.\n\nThere are a handful of [code examples](https://github.com/dinubs/lucid/tree/master/example) (I've done my best to comment as much as possible) and examples you can [play](https://lucid.dinubs.now.sh).\n\n# Install and Use\n\nYou can install the engine with `npm install lucid-game-engine`. Then you can use the package like the below.\n\n```javascript\nimport { Lucid, Map, Block } from 'lucid-game-engine';\n\nvar canvas = document.getElementById('canvas');\n\ncanvas.width = window.innerWidth;\ncanvas.height = window.innerHeight;\n\nvar game = new Lucid({\n  alertErrors: true,\n  canvas,\n  logInfo: true,\n});\n\nvar Loop = function () {\n  game.setViewport(canvas.width, canvas.height);\n  game.update();\n  game.draw();\n  window.requestAnimFrame(Loop);\n};\n\nclass MyCustomMap extends Map {\n  constructor() {\n    super({\n      backgroundColor: \"#4e4e4e\",\n      tileSize: 29,\n      playerStart: {\n        x: 1,\n        y: 2\n      },\n      movementSpeed: {\n        jump: 8,\n        horizontal: 1\n      }\n    });\n\n    // Load the blocks so the engine knows which one to render\n    // based on the map data.\n    this.blocks = [Block];\n\n    // mapData signifies to the engine what blocks to render where.\n    // An empty space will render an EmptyBlock.\n    this.mapData = [\n      [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n      [0, , , , , , , , , , , , , , , , , , 0],\n      [0, , , , , , , , , , , , , , , , , , 0],\n      [0, , , , , , , , , , , , , , , , , , 0],\n      [0, , , , , , , , , , , , , , , , , , 0],\n      [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n    ];\n  }\n}\n\ngame.loadMap(new MyCustomMap());\n\nLoop();\n```\n\nI personally suggest using [Parcel](https://parceljs.org/) to get things up and running, it's very straight forward. Check out the [example](https://github.com/dinubs/lucid/tree/master/example) directory for how it works, and run them using `npm run example` when you clone the repo (it uses Parcel to run).\n\n\n# TODO\n\n- [ ] Rename Map to something else, realized a little late that Map is a reserved keyword in JS\n- [ ] Particle engine\n- [ ] Entities (Think NPCs and enemies that the player can interact with).\n- [ ] Allow adding a custom player class to the game, will be easy to do, but forgot to integrate it.\n- [ ] Allow setting a custom EmptyBlock per map, that way you can do any custom rendering on the block you want.\n- [ ] Add more information to the readme.\n\nIf you want to tackle any of the above TODO items, please open a pull request, I'd gladly review it :D\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinubs%2Flucid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinubs%2Flucid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinubs%2Flucid/lists"}