{"id":16942158,"url":"https://github.com/samouri/buckle-frogger","last_synced_at":"2025-10-14T09:15:45.133Z","repository":{"id":71231727,"uuid":"134305307","full_name":"samouri/buckle-frogger","owner":"samouri","description":"Frogger clone","archived":false,"fork":false,"pushed_at":"2018-06-13T18:02:14.000Z","size":5066,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-11T19:53:13.102Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://samouri.github.io/bucklefrog","language":"OCaml","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/samouri.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":"2018-05-21T17:55:52.000Z","updated_at":"2024-09-06T17:23:35.000Z","dependencies_parsed_at":"2023-02-25T13:00:56.897Z","dependency_job_id":null,"html_url":"https://github.com/samouri/buckle-frogger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samouri/buckle-frogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samouri%2Fbuckle-frogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samouri%2Fbuckle-frogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samouri%2Fbuckle-frogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samouri%2Fbuckle-frogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samouri","download_url":"https://codeload.github.com/samouri/buckle-frogger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samouri%2Fbuckle-frogger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018504,"owners_count":26086383,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"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":[],"created_at":"2024-10-13T21:11:13.650Z","updated_at":"2025-10-14T09:15:45.098Z","avatar_url":"https://github.com/samouri.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [BuckleFrog](https://samouri.github.com/bucklefrog)\n\n[BuckleFrog](https://samouri.github.com/bucklefrog) is an HTML5 Canvas based implementation of the 1981 Konami classic Frogger game. It is written in OCaml and transpiled to JavaScript.\n\n![gameplay gif](https://github.com/FriteGames/buckle-frogger/raw/master/gameplay.gif)\n\n[Click here](https://samouri.github.com/bucklefrog) to play!\n\n## Gamplay features\n\n* A cute frog with a pleasant jumping animation\n* A highway and river, both perfect for killing said frog\n* High score tracking so you can get needlessly competitive with your friends\n\n## Technical description\n\nThe code is written in OCaml, transpiled to JavaScript via [bucklescript](https://bucklescript.github.io/), and then bundled with [parcel](https://parceljs.org/). All in all, incremental compilations are usually complete within 100ms.\n\nThe game features a pretty standard gameloop in `index.ml`. The most remarkable part of the code is how state is updated on each frame. In order to use a functional approach (as opposed to a more standard object oriented one), state is updated via a reducer-like function with the signature: `val stepWorld: worldT -\u003e int -\u003e worldT`. `stepWorld` takes in the current world and the time elapsed since the last frame, then returns the next state of the world.\n\nWithin `stepWorld` there is a multi-pass architecture [similar to some compilers](https://en.wikipedia.org/wiki/Multi-pass_compiler). Each \"pass\" has responsibility for updating a single piece of state or generating some intermediate values. For example `updateHighScore` is an example of a pass that checks if the current score is greater than the high score and updates the highscore if necessary. Some passes don't update any final state and are only responsible for generating some intermediate data. An example of that would be `findCollisions`. Collision data is necessary for other passes to operate, but isn't actually necessary for rendering and so doesn't end up in `worldT`.\n\n**modules**\n\n* _index.ml_: Contains the gameloop and initialization code\n* _render.ml_: All of the logic for rendering to the canvas.\n* _types.ml_: All of the types used in the game\n* _state.ml_: `stepWorld` and all of the logic for updating state.\n* _utils.ml_: Things that I had no idea where else to put. e.g. a new binary operator for generating a range between two numbers.\n\n## To Run\n\n```\nnpm run build\nnpm run parcel\n```\n\n## To Develop\n\nOpen up two terminals.\nIn the first run\n\n```\nnpm run watch\n```\n\nIn the second run\n\n```\nnpm run parcel\n```\n\n##\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamouri%2Fbuckle-frogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamouri%2Fbuckle-frogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamouri%2Fbuckle-frogger/lists"}