Screeps is an open-source "MMO sandbox game for programmers". The core mechanic involves programming your units' AI and competing against other players for scarce resources.
The running game can be viewed from a web browser or inside the stand-alone Steam client. The game client supports coding directly, but this can be a challenging environment in which to code and maintain more than a few simple scripts.
The screeps-typescript-starter
repository provides everything you need to quickly get a Screeps project off the ground in Typescript.
This starter template is setup for TypeScript (but will also work well with JavaScript files), and uses Grunt and ESLint to lint and build. The built code is deployed to the specified Screeps account using the grunt-screeps plugin.
- Create a Screeps account.
- Clone a copy of this repository and run
npm install
in the project root directory. - Create a
.screeps.json
file in the project root directory and provide your screeps account credentials.
{
"email": "<email>",
"password": "<password>",
"branch": "default",
"ptr": false
}
The main.ts
loop
method is ready to begin adding your own Creep AI. Two starter methods are included to write game ticks to the console log, and to clean up dead Creeps from memory.
The build
command will lint and compile all src/**/*.ts
files.
grunt build
The deploy
command will lint, compile, and deploy all built dist/*.js
files to the specified screeps account.
grunt deploy
Once committed, the targeted screeps account will begin running the new code right away.
This project is linted using ESLint
with the typescript-eslint
plugin.
Linting rules can be adjusted in the .eslintrc.yaml
file.