Skip to content

Latest commit

 

History

History
81 lines (63 loc) · 1.91 KB

README.md

File metadata and controls

81 lines (63 loc) · 1.91 KB

Laboratory RL

A roguelike game built with TypeScript and the rot.js library. The game is currently in the planning and design phase. It's not playable in it's current state, but if you're interested anyway follow this link https://mizar999.github.io/laboratory-rl/

Resources

Project setup

  • Init npm and install necessary packages

    git clone https://github.com/Mizar999/laboratory-rl.git
    npm install
  • Create Webpack configuration webpack.config.js:

    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:

    {
        "compilerOptions": {
            "target": "es5"
        },
        "include": [
            "src/*"
        ]
    }
  • Update the scripts-section of the package.json file:

    "scripts": {
        "build": "webpack",
        "watch": "webpack --watch",
        "serve": "http-server --port=8085 -c-1"
    }
  • To build the application run:

    npm run-script build
  • To run multiple npm scripts cross platform in parallel run the following command:

    # if globally installed
    concurrently npm:watch npm:serve
    
    # if locally installed
    npx concurrently npm:watch npm:serve