This is a Screeps' project skeleton for Typescript programmers. The skeleton is based on vanhouc's work: https://github.com/vanhouc/screeps.
Screeps is MMO strategy open world game for programmers. You write real JavaScript (in this case Typescript) which controls your units autonomously.
Read more: https://screeps.com/
This skeleton is cross platform. You can easily run the project with Jetbrains PHPStorm or use it in your VStudio. TS->JS compiling is done by TSProject.
Skeleton includes everything you need to get up and running as quickly as possible.
Screep API typescript type definitions are incuded as dependency. See their up to date status in here GitHUB link
Discussion in screep's community forum
Required dependencies:
NodeJS https://nodejs.org/en/
- `npm` command available in your CLI
Optional dependencies (only if you want to follow these installation instructions fully):
GIT https://git-scm.com/
- `git` command available in your CLI (if you want to follow these instructions)
$ git clone git@github.com:MarkoSulamagi/Screeps-typescript-skeleton.git
$ cd Screeps-typescript-skeleton
$ npm install
Rename secrets.default.js file to secrets.js
Fill "username" and "password" properties in just renamed secrets.js file with your Screep's username and email.
**NEVER COMMIT THIS FILE TO ANY VERSION CONTROL**
To run the compiler and uploader, navigate to your project folder and run this command
$ npm start
Now every time you edit your typescript files, main.js in ./dist folder is uploaded to your Screep scripts into "default" branch.
Project files are in ./src.
./src/main.ts - Application bootstrap. Don't change this file
./src/start/game-manager.ts - Your main module. This is where the program starts. There are instructive comments in the class file.
./src/screeps.d.ts - Typescript interfaces for Screep's API. This includes autocomplete and data types to your project. This file can get outdated if Screep's team adds new functionality or changes something.
./dist - Your compiled files. This will be created automatically. No need to change anything in here.
./typings - Lo-Dash Typescript interfaces. Created automatically and no need to change anything.
https://github.com/MarkoSulamagi/Screeps-typescript-skeleton/issues/9
Unfortunately I haven't been able to create tutorial for this yet. Issue about it is here: Documentation for migrating your bot to Typescript #4
Because Typescript compiler can also read Javascript, migrating should be possible with fairly few changes to your code.
No tests. Testing can definitely be done, but it's out of this project's scope. You can use Jasmine and Karma to create unit tests. You might need to implement some dependency injection system.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details