Giter Club home page Giter Club logo

screepsdevspace's Introduction

ScreepsDevSpace

Screeps World 的代码开发环境搭建

Features Info

  • 自动补全
  • rollup一行命令打包上传
image
  • ErrorMap跟踪报错
image
  • 支持ts开发

How To Use

三种运行模式

  • 本地部署,JetBrains-Webstorm连接 —— 功能稳定
  • GitHub CodeSpace部署 —— 便捷的云端开发环境
  • docker部署,JetBrains-Gateway SSH连接(待更新)

本地部署

1. 本地环境准备

本地环境 node>=16 npm>=8 (以上版本为实际使用可行版本,不代表其他版本不可用,建议先测试一下)

2. 下载项目文件

git clone https://github.com/wper-golo/ScreepsDevSpace.git

3. 安装环境依赖

npm install

4. 申请Screeps World Token

token 可以从 https://screeps.com/a/#!/account/auth-tokens 获取 image

5. 修改 ./.secret.json 文件

{
    "main": {
        "token": "你的 screeps token 填在这里",
        "protocol": "https",
        "hostname": "screeps.com",
        "port": 443,
        "path": "/",
        "branch": "default"
    },
    "local": {
        "copyPath": "你要上传到的游戏路径,例如 C:\\Users\\DELL\\AppData\\Local\\Screeps\\scripts\\screeps.com\\default"
    }
}

注意需要填写里边的 main.token 字段和 local.copyPath 字段(如果你不想用这种方式的话可以直接不填) copyPath 可以通过游戏客户端控制台左下角的 Open local folder 按钮找到。

6. 在 ./src/ 文件夹下自由编写你Screeps Codes!

7. 将代码打包到本地(可选)

npm run local

8. push 你的代码到Screeps World

npm run push

CodeSpace部署

1. Fork项目到本地

image

2. 开启Github CodeSpace

image

Tips:

  • CodeSpace配置最好上 4Core 16RAM的配置,防止JB的Gateway连接不上,并选择一个区域(根据你访问github的ip地址选择ping延迟较小的节点)
  • CodeSpace 使用完毕记得Stop,防止产生不必要的消费

3. JetBrains Gateway连接CodeSpace(可选)

image Tips: - JB GateWay连接记得开启自动保存功能,因为Gateway暂时是beta版,有可能会出现一些问题导致崩溃

4. 申请Screeps World Token

token 可以从 https://screeps.com/a/#!/account/auth-tokens 获取 image

5. 修改 ./.secret.json 文件

Tips:请保护好自己的token,不要push到github上,造成一些不必要的麻烦

{
    "main": {
        "token": "你的 screeps token 填在这里",
        "protocol": "https",
        "hostname": "screeps.com",
        "port": 443,
        "path": "/",
        "branch": "default"
    },
    "local": {
        "copyPath": "你要上传到的游戏路径,例如 C:\\Users\\DELL\\AppData\\Local\\Screeps\\scripts\\screeps.com\\default"
    }
}

注意需要填写里边的 main.token 字段和 local.copyPath 字段(如果你不想用这种方式的话可以直接不填) copyPath 可以通过游戏客户端控制台左下角的 Open local folder 按钮找到。

6. 在 ./src/ 文件夹下自由编写你Screeps Codes!

Tips: 如果想要保留errorMapper的功能,就不要修改./src/modules/errorMapper中的内容。 新手入门Screeps World:

7. push 你的代码到Screeps World

npm run push

一些声明

开发背景

本项目是本人通过对大佬HoPGoldy的简书教程进行的归纳整理,因为一些包版本等问题走了一些弯路,希望来玩Screeps World的玩家不要被开发环境不够优雅这种问题劝退,希望大家可以开心体验这款好玩的游戏。

参考教程

ps:如果有帮助可以给个Star 🙏

image

screepsdevspace's People

Contributors

wper-golo 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.