{"id":31595266,"url":"https://github.com/escherize/glick80","last_synced_at":"2026-02-17T04:31:58.426Z","repository":{"id":316118900,"uuid":"1061964427","full_name":"escherize/glick80","owner":"escherize","description":"tic80 bindings for gleam","archived":false,"fork":false,"pushed_at":"2025-09-25T01:43:05.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-06T03:59:04.409Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Gleam","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/escherize.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":"2025-09-22T16:09:54.000Z","updated_at":"2025-09-25T01:43:09.000Z","dependencies_parsed_at":"2025-09-22T20:38:27.995Z","dependency_job_id":null,"html_url":"https://github.com/escherize/glick80","commit_stats":null,"previous_names":["escherize/glick80"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/escherize/glick80","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fglick80","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fglick80/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fglick80/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fglick80/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/escherize","download_url":"https://codeload.github.com/escherize/glick80/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fglick80/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29533702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T03:01:11.216Z","status":"ssl_error","status_checked_at":"2026-02-17T03:00:31.803Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2025-10-06T03:58:51.167Z","updated_at":"2026-02-17T04:31:58.411Z","avatar_url":"https://github.com/escherize.png","language":"Gleam","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glick80\n\n[![Package Version](https://img.shields.io/hexpm/v/glick80)](https://hex.pm/packages/glick80)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/glick80/)\n\nA Gleam library for building TIC-80 fantasy console games with pure functional programming.\n\n## Philosophy\n\nThis library embraces Gleam's functional nature by treating all TIC-80 callbacks as pure functions that take and return state. The JavaScript shim handles the imperative state management, while your Gleam code remains purely functional and easily testable.\n\n## Usage\n\n```sh\ngleam add glick80@1\n```\n\nDefine your game state and implement TIC-80 callbacks:\n\n```gleam\nimport glick80_api as g\n\npub type State {\n  State(player_x: Float, player_y: Float, frame: Int)\n}\n\npub const initial_state = State(120.0, 68.0, 0)\n\n// Main game loop - called 60 times per second\npub fn tic(state: State) -\u003e State {\n  let new_state = update_game(state)\n  draw_game(new_state)\n  new_state\n}\n\n// Optional TIC-80 callbacks - all take and return state\npub fn boot(state: State) -\u003e State {\n  // Initialize your game\n  state\n}\n\npub fn bdr(row: Int, state: State) -\u003e State {\n  // Called for each scanline during drawing\n  state  \n}\n\npub fn menu(index: Int, state: State) -\u003e State {\n  // Handle menu interactions\n  state\n}\n\npub fn scn(row: Int, state: State) -\u003e State {\n  // Called between scanlines\n  state\n}\n```\n\nThe JavaScript shim automatically detects which callbacks you've implemented and wires them to TIC-80, handling all state persistence between frames.\n\n## TIC-80 Callback Reference\n\n| Function | Parameters | When Called | Typically Updates State? |\n|----------|------------|-------------|--------------------------|\n| `tic(state)` | `State` | Every frame (60fps) | ✅ Yes - main game logic |\n| `boot(state)` | `State` | Game startup | ✅ Yes - initialize game |\n| `menu(index, state)` | `Int, State` | Menu interactions | ✅ Maybe - menu state |\n| `bdr(row, state)` | `Int, State` | Each scanline | ❌ Rarely - visual effects |\n| `scn(row, state)` | `Int, State` | Between scanlines | ❌ Rarely - visual effects |\n\nAll functions must take state as their last parameter and return the (possibly modified) state. This ensures your game logic remains purely functional and testable.\n\n## API Functions\n\nThe `glick80_api` module provides bindings to all TIC-80 functions:\n\n```gleam\nimport glick80_api as g\n\n// Drawing\ng.cls(color: Int)                    // Clear screen\ng.pix(x: Int, y: Int, color: Int)    // Set pixel\ng.spr(id: Int, x: Float, y: Float)   // Draw sprite\ng.rect(x: Int, y: Int, w: Int, h: Int, color: Int)  // Draw rectangle\ng.print(text: a, x: Int, y: Int)     // Print text\n\n// Input  \ng.btn(id: Int) -\u003e Bool               // Button pressed\ng.btnp(id: Int) -\u003e Bool              // Button just pressed\ng.mouse() -\u003e Mouse                   // Mouse state\n\n// Audio\ng.sfx(id: Int)                       // Play sound effect\ng.music(track: Int)                  // Play music\n\n// And many more...\n```\n\nFurther documentation can be found at \u003chttps://hexdocs.pm/glick80\u003e.\n\n## Development\n\n```sh\ngleam run   # Run the project\ngleam test  # Run the tests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescherize%2Fglick80","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fescherize%2Fglick80","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescherize%2Fglick80/lists"}