Skip to content

stevenvaneyck/SimulatorCore

 
 

Repository files navigation

Simulator Core

setup

after installing node:

$ npm install
$ npm run start-web

then browsing to http://localhost:8080 should show you the results. any changes made to the code will cause a reload.

Adding a New Demo

To add a new demo for local development / testing purposes, follow these steps:

  1. Add a new Canvas to the index.html file
<!DOCTYPE html>
<html>
  <head>
    <style>
      body {
        display: flex;
        flex-direction: column;
        align-items: center;
      }
    </style>
  </head>
  <body>
    <canvas id="demo1" width="800" height="600"></canvas>
    + <canvas id="demo2" width="800" height="600"></canvas>
    <!-- NOTE: SCRIPTS WILL BE AUTOMATICALLY ADDED BY WEBPACK BELOW THIS COMMENT -->
  </body>
</html>
  1. Add a new demo file to src/demos
  2. Add the demo to the webpack.config.js in the entry points object
entry: {
    demo1: "./src/demos/demo1.ts",
    demo2: "./src/demos/demo2.ts"
},
  1. Run npm run start-web. At this point, any changes you make to your new demo file should be reflected on localhost:8080

using as a module (local development)

$ npm install
$ npm run build
$ npm link

Then in the project you want to use this module in, run:

$ npm link @fruk/simulator-core

Packages

No packages published

Languages

  • TypeScript 98.5%
  • JavaScript 1.2%
  • HTML 0.3%