-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/seifer8ff/rotjs-typescrip…
- Loading branch information
Showing
1 changed file
with
18 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
# rot.js TypeScript basics | ||
# Sim World | ||
|
||
A basic roguelike example built with rot.js and TypeScript. Playable at [https://mizar999.github.io/rotjs-typescript-basics/](https://mizar999.github.io/rotjs-typescript-basics/) | ||
|
||
## Resources | ||
|
||
- [rot.js - Roguelike Toolkit](https://github.com/ondras/rot.js) | ||
- [RogueBasin - rot.js Tutorial](http://www.roguebasin.roguelikedevelopment.org/index.php?title=Rot.js_tutorial) | ||
- [Frostlike - 7 Day Roguelike Challenge 2017 entry](https://github.com/maqqr/7drl2017) | ||
A prototype of a colony management game, in which the environment (plants, climate, weather) is deeply simulated. The entities living in this world will be powered by the latest LLM AI, and will populate, build, and maintain the environment over many generations. | ||
|
||
## How to run | ||
|
||
|
@@ -15,15 +9,26 @@ After cloning the repository: | |
- Install necessary packages | ||
|
||
```powershell | ||
npm install | ||
npm ci | ||
``` | ||
|
||
- To build the assets, run: | ||
```powershell | ||
npm run build:assets | ||
``` | ||
|
||
- To build the application run: | ||
- To build the application, run: | ||
|
||
```powershell | ||
npm run build | ||
``` | ||
|
||
- To run the application using the dev server, run: | ||
|
||
```powershell | ||
npm run dev | ||
``` | ||
|
||
- To run multiple npm scripts cross platform in parallel run the following command: | ||
|
||
```powershell | ||
|
@@ -34,66 +39,6 @@ After cloning the repository: | |
npx concurrently npm:watch npm:serve | ||
``` | ||
|
||
## Initial Project setup | ||
|
||
If you're interested here is my initial project setup: | ||
|
||
- Init npm and install necessary packages | ||
|
||
```powershell | ||
npm init -y | ||
npm install --save-dev [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] | ||
``` | ||
|
||
- Create **Webpack** configuration `webpack.config.js`: | ||
|
||
```javascript | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
entry: "./src/app.ts", | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
use: "ts-loader", | ||
exclude: /node_modules/, | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: [".ts", ".tsx", ".js"], | ||
}, | ||
output: { | ||
filename: "app.js", | ||
path: path.resolve(__dirname, "dist"), | ||
}, | ||
mode: "development", | ||
}; | ||
``` | ||
|
||
- Webpack will get the sources from `src/app.ts` and collect everything in `dist/app.js` file | ||
- Create **TypeScript** configuration `tsconfig.json`: | ||
|
||
```json | ||
{ | ||
"compilerOptions": { | ||
"target": "es5" | ||
}, | ||
"include": ["src/*"] | ||
} | ||
``` | ||
|
||
- Update the **scripts**-section of the `package.json` file: | ||
|
||
```json | ||
"scripts": { | ||
"build": "webpack", | ||
"watch": "webpack --watch", | ||
"serve": "http-server --port=8085 -c-1" | ||
} | ||
``` | ||
|
||
## Development Guide | ||
|
||
This project uses rot.js as the game framework, and pixijs for rendering and handling sprites. | ||
|
@@ -105,4 +50,6 @@ This project uses rot.js as the game framework, and pixijs for rendering and han | |
npm run build:assets | ||
``` | ||
|
||
Find the rebuilt sprite sheets in public/assets | ||
Find the rebuilt sprite sheets in public/sprites. | ||
|
||
|