GithubHelp home page GithubHelp logo

polterix / visual-code-tic-80 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alrado/visual-code-tic-80

0.0 1.0 0.0 4.12 MB

Visual Studio Code settings for TIC-80 game developers

License: GNU General Public License v3.0

visual-code-tic-80's Introduction

Visual-Code-TIC-80

Visual Studio Code settings for TIC-80 game developers.

Support JavaScript, Lua and MoonScript.

For convenient work with JavaScript, Lua and MoonScript enable them in Visual Studio Code.

Run JavaScript, Lua or MoonScript code in TIC-80 with output to the console.

  1. Install Code Runner plugin for Visual Studio Code.
  2. Add tic80 executable to path environment variable or add into settings "code-runner.cwd": "C:\Program Files\TIC-80\"- path to your tic application.
  3. Describe the following settings in the workspace settings or user settings:
    // Set the executor of each language.
    "code-runner.executorMap": {
        "javascript":   "tic80 C:\\Users\\alrad\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\$fileNameWithoutExt.tic -code-watch $fullFileName",
        "lua":          "tic80 C:\\Users\\alrad\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\$fileNameWithoutExt.tic -code-watch $fullFileName",      
        "moonscript":   "tic80 C:\\Users\\alrad\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\$fileNameWithoutExt.tic -code-watch $fullFileName"      
    },
    // Whether to save the current file before running.
    "code-runner.saveFileBeforeRun": true,
    // Whether to clear previous output before each run.
    "code-runner.clearPreviousOutput": true,
    // Whether to ignore selection to always run entire file.
    "code-runner.ignoreSelection": true,
    // The number of spaces a tab is equal to. This setting is overriden based on the file contents when `editor.detectIndentation` is on.
    "editor.tabSize": 2

Where path C:\\Users\\alrad\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\ - is the folder where your cards with *.tic are saved. If you want find it, type folder in TIC-80 console.
If a cartridge with the same name as the code file name is not found, the default cartridge will start and your code will be loaded into it.
4. To start, click on the "Run Code" button or the CTRL+ALT+N

TIC-80 API user snippets for Visual Studio Code.

  1. Open the file in the language to which you want to add snippets (.lua, .moon, .js, .ts)
  2. In Visual Studio Code open: File->Preferences->User Snippets, find language (e.g. lua), copy and paste the corresponding json.

TIC-80 API declarative files (TypeScript) and documentation.

  1. In order for TypeScript not to cause errors related to the application of TIC-80 API functions, copy the file tic80_api.d.ts to your project. In this file, all functions of the TIC-80 API are declared and documented.
  2. To display a description of the functions of the TIC-80 API when working with JavaScript, simply open the tic-80_api.d.ts file in Visual Studio Code and leave it open. If necessary, restart the editor.

Visual-Code-TIC-80

Настройки Visual Studio Code для разработчиков игр TIC-80.

Поддержка JavaScript, Lua и MoonScript.

Для удобной работы с JavaScript, Lua и MoonScript включите их поддержку в Visual Studio Code.

Запуск кода JavaScript, Lua или MoonScript в TIC-80 с выводом в консоль.

  1. Установите Code Runner плагин для Visual Studio Code.
  2. Добавьте tic80 исполняемый файл в переменную окружения Path или добавьте в настройки "code-runner.cwd": "C:\Program Files\TIC-80\" - путь к вашему приложению tic.
  3. Пропишите следующие настройки в параметрах рабочей области или в параметрах пользователя:
    // Set the executor of each language.
    "code-runner.executorMap": {
        "javascript":   "tic80 C:\\Users\\alrad\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\$fileNameWithoutExt.tic -code-watch $fullFileName",
        "lua":          "tic80 C:\\Users\\alrad\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\$fileNameWithoutExt.tic -code-watch $fullFileName",      
        "moonscript":   "tic80 C:\\Users\\alrad\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\$fileNameWithoutExt.tic -code-watch $fullFileName"     
    },
    // Whether to save the current file before running.
    "code-runner.saveFileBeforeRun": true,
    // Whether to clear previous output before each run.
    "code-runner.clearPreviousOutput": true,
    // Whether to ignore selection to always run entire file.
    "code-runner.ignoreSelection": true,
    // The number of spaces a tab is equal to. This setting is overriden based on the file contents when `editor.detectIndentation` is on.
    "editor.tabSize": 2

Где путь C:\\Users\\alrad\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\ - это путь к папке, где сохранены Ваши файлы с расширением *.tic. Если Вам нужно найти её, наберите команду folder в консоли TIC-80.
Если картридж с таким же именем как и имя файла кода не найден, запустится дефолтный картридж и в него загрузится Ваш код.
3. Для запуска нажмите на кнопку "Run Code" или клавиши CTRL+ALT+N

TIC-80 API пользовательские сниппеты для Visual Studio Code.

  1. Откройте файл на том языке, к которому Вы хотите добавить сниппеты (.lua, .moon, .js, .ts)
  2. В Visual Studio Code откройте: File->Preferences->User Snippets, найдите язык (например lua), скопируйте и вставьте соответствующий json.

TIC-80 API декларирующие файлы(TypeScript) и документация.

  1. Для того чтобы TypeScript не вызывал ошибки связанные с применением функций TIC-80 API, скопируйте в свой проект файл tic80_api.d.ts В этом файле задекларированы и задокументированы все функции TIC-80 API.
  2. Для отображения описания функций TIC-80 API при работе с JavaScript просто откройте файл tic-80_api.d.ts в Visual Studio Code и оставьте открытым. При необходимости перезапустите редактор.

visual-code-tic-80's People

Contributors

alrado avatar buoyancydabl avatar gi972 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.