{"id":13633198,"url":"https://github.com/scambier/tic80-typescript","last_synced_at":"2025-03-17T10:34:03.887Z","repository":{"id":38010949,"uuid":"96463633","full_name":"scambier/tic80-typescript","owner":"scambier","description":"Create your TIC-80 games with TypeScript","archived":false,"fork":false,"pushed_at":"2024-03-23T08:27:27.000Z","size":127,"stargazers_count":51,"open_issues_count":0,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-01T13:56:00.319Z","etag":null,"topics":["bundler","fantasy-console","tic-80"],"latest_commit_sha":null,"homepage":"","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/scambier.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":"2017-07-06T19:09:20.000Z","updated_at":"2024-06-14T03:53:56.739Z","dependencies_parsed_at":"2024-01-14T09:10:50.481Z","dependency_job_id":"3ac61aaf-da9f-4319-a93b-4fb99426ae42","html_url":"https://github.com/scambier/tic80-typescript","commit_stats":{"total_commits":110,"total_committers":8,"mean_commits":13.75,"dds":"0.34545454545454546","last_synced_commit":"df667dfc25f45c45823ab9ee5259bbe9c9ff3e63"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scambier%2Ftic80-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scambier%2Ftic80-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scambier%2Ftic80-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scambier%2Ftic80-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scambier","download_url":"https://codeload.github.com/scambier/tic80-typescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221675244,"owners_count":16861860,"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":["bundler","fantasy-console","tic-80"],"created_at":"2024-08-01T23:00:30.303Z","updated_at":"2024-10-27T12:32:42.767Z","avatar_url":"https://github.com/scambier.png","language":"JavaScript","funding_links":[],"categories":["Resources"],"sub_categories":["Miscellaneous"],"readme":"# TSC-80 - TypeScript for the TIC-80\n\n![](logo.png)\n\n---\n\n_The documentation for TSC-80 **1.0** is available [here](https://github.com/scambier/tic80-typescript/tree/v1) - Projects created for TSC-80 1.0 are incompatible with 2.0_\n\n---\n\nWrite your [TIC-80](https://tic80.com/) **PRO** games in TypeScript.\n\nTSC-80 contains all the functions declarations (`.d.ts`) for the TIC-80 API, and will compile your TypeScript code in JavaScript to inject it into your TIC-80 cart.\n\n## Installation and usage\n\n### Pre-requisites\n\nThis tool has been tested with TIC-80 version 1.2.x (pro edition) on Windows 10, and should work on all platforms compatible with TIC-80 and TypeScript.\n\n1. Install NodeJS LTS\n2. Install TypeScript: `npm install -g typescript`\n3. Install TSC-80: `npm install -g tic80-typescript`\n\n### Create a project\n\n1. `tsc80 init` will create the necessary files (config, declarations, and game files) into the current directory\n2. Set the correct values inside the `tsc80-config.json`\n\n### Configuration\n\nYou need to complete the `tsc80-config.json` for each project.\n\n```js\n{\n  \"ticExecutable\": \"path/to/tic/executable/file\", // The file path to your TIC executable.\n  \"entry\": \"main.ts\", // The entry point of your game's code\n  \"outfile\": \"build/output.js\", // Path to bundled file. You should not have to change this.\n  \"minify\": false // If you want to minify your build. May provide very slight performances improvements\n}\n```\n\n### Run TSC-80\n\n- `$ tsc80 build` will build your game into the \"build\" directory\n- `$ tsc80 run` will build, watch the changes, and launch your game through TIC-80\n\nOnce that TIC-80 is running, all code changes in .ts files will be reflected after a reload (`ctrl+r`). You can update and save your assets directly in TIC-80.\n\n### Workflow\n\n`$ tsc80 run` continuously watches changes in your .ts files and compiles them on the fly. You then alt-tab to TIC-80, and hit `ctrl+r` to reload the game.\nThis instructs TIC-80 to load `game.js` and inject the compiled code inside the cart.\n\n❗ You **must not** edit the compiled JavaScript code inside the TIC-80 editor. Your changes would be overwritten.\n\nYou **must** only edit **assets** (sprites, map, sounds, music) inside the TIC-80 editor. **Don't forget to save your changes _before_ reloading the code.**\n\nWhen you hit `ctrl+s` inside TIC-80, `game.js` is saved as a standalone TIC-80 cart.\n\n#### Version control\n\nThe `build` folder can be ignored, but you **must** commit `game.js`, since it contains all non-code assets.\n\n## Code \u0026 Modules\n\nIf you know TypeScript and modern web development, writing your TIC-80 game with TSC-80 should be straightforward. It uses [esbuild](https://esbuild.github.io/) to compile and bundle the code, targets `ES2020` and uses the modern ESM syntax (`import` \u0026 `export`).\n\n`tsc80 build|run` only transpiles your TypeScript files to JavaScript, and compiles them together as a single output file. Internally, TIC-80 uses [QuickJS](https://github.com/nesbox/quickjs) as its JavaScript engine.\n\nThe following limitations apply:\n\n- JS code up to ES2020. This tool does not provide polyfills.\n- ! No `export` from your entry file\n- Required to have a single file output\n- Tree-shaking is disabled by default, as esbuild would strip important \"unused\" functions like `TIC()`\n\n## Issues\n\n**TIC-80 doesn't reload my code**\n\nIf you're building TIC-80 yourself, make sure to use the correct settings\n\n```sh\n$ cd \u003cpath-to-tic\u003e/build\n$ cmake -G \"Visual Studio 16 2019\" -DBUILD_PRO=On -DCMAKE_BUILD_TYPE=MinSizeRel ..\n$ cmake --build . --config MinSizeRel --parallel\n```\n\n## Changelog\n\n### 2.0.0 - 2024-02-16 - BREAKING CHANGES\n\n- Projects created for TSC-80 1.0 must be refactored to be compatible with 2.0\n- Builds are now done with esbuild, instead of `tsc`\n- Projects now use ESM, with `import` and `export`\n\n### 1.1.0 - 2023-08-18\n\n- Formal tsconfig update to output ES2020 code for TIC-80 1.1.x\n\n### 1.0.3 - 2023-08-09\n\n- Dependencies update\n\n### 1.0.1 - 2022-06-22\n\n- Cleaner code\n- Fixed race condition by @tmountain\n\n### 1.0.0 - 2022-05-15\n\n- Official release for TIC-80 1.0\n- Added `ttri()`\n\n### 1.0.0-dev - 2021-08-19\n\n- Refactoring to make this tool compatible with TIC-80 1.0.x-dev\n- Simplified workflow\n- Added `peek1()`, `peek2()`, `poke1()`, `poke2()`, `vbank()`\n\n### 0.4.9 - 2021-07-17\n\n- Added `elli()`, `ellib()`, and `trib()`\n\n### 0.4.8 - 2021-04-19\n\n- Fixed `mouse()` signature\n\n### 0.4.7 - 2021-04-08\n\n- Removing `\"use strict\"` from output file, since it breaks the global scope in TIC-80 engine.\n- Updated dependencies\n- Stricter TypeScript\n- Better documentation\n\n### 0.4.6 - 2021-04-03\n\n- Cleaned a bit of code\n- Added information in README\n- `compress` and `mangle` now default to true\n\n### 0.4.5 - 2020-06-15\n\n- Added new function declarations (up-to-date with TIC version 0.80)\n- Added jsdocs for all functions. Thanks a lot @miltoncandelero\n\n### 0.4.3 - 2019-01-17\n\n- Fixed the return types of multiple functions\n- Updated the boilerplate code to meet TS standards\n\n### 0.4.2 - 2018-04-19\n\n- Added `key()`, `keyp()` and `reset()` declarations\n- Updated the boilerplate code for latest TIC-80 version\n- Updated README for better, step-by-step instructions\n\n### 0.4.1 - 2017-10-13\n\n- Fixed missing input support (thanks @matanegui)\n- Fixed `tsc80` cmd help message\n\n### 0.4 - 2017-10-08\n\n- Added `textri()` declaration\n\n### 0.3 - 2017-08-05\n\n- Refactored code\n\n### 0.2 - 2017-08-04\n\n- Making a real npm package\n\n### 2017-07-31\n\n- Added a `backup` option to copy your cart to your project's folder\n\n### 2017-07-29\n\n- Updated `print()` and `spr()` declarations\n\n### 2017-07-27\n\n- Added `exit()` declaration to `tic.d.ts`\n- Updated `README.md`\n\n### 2017-07-19\n\n- Updated `tic.d.ts`\n\n### 2017-07-11\n\n- Compile from TS to JS (_finally..._)\n- Renamed \"main.ts\" to \"sample.ts\"\n- Described a small trick to ensure that the init code waits for its dependencies\n- Removed the `require` of the compiled file\n- Cleared README a bit\n\n### 2017-07-09\n\n- Added a `require` of the compiled code to catch exceptions\n- Added uglify-js to compress the compiled code\n- Rewrote the launch script\n\n### 2017-07-06\n\n- Project birth: created a definitions file for TIC-80, and a `tsconfig.json`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscambier%2Ftic80-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscambier%2Ftic80-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscambier%2Ftic80-typescript/lists"}