Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
seifer8ff committed Feb 15, 2024
2 parents 2fdcb74 + c56dfd2 commit 45c9b20
Showing 1 changed file with 18 additions and 71 deletions.
89 changes: 18 additions & 71 deletions README.md
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

Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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.


0 comments on commit 45c9b20

Please sign in to comment.