@fruk/simulator-core
v1.8.11
Published
FIRST Robotics Simulator Core
Downloads
46
Readme
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:
- 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>
- Add a new demo file to src/demos
- Add the demo to the webpack.config.js in the entry points object
entry: {
demo1: "./src/demos/demo1.ts",
demo2: "./src/demos/demo2.ts"
},
- 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