https://github.com/senergin/elevator-babylonjs
Built in an afternoon, I wanted to play with the idea and Babylon.js a bit.
- npm install .
- npm run build . This should start a watch process.
- Open index.html
- When idle, elevator will ascend to serve requests. Else it will descend.
- When going in a direction, elevator will pick up all passangers going in the same direction.
- Elevator will serve requests given inside the elevator.
- Per simulation step, elevator can move between one floor to another, and decide whether to pick up (or drop) passengers.
- Center of the screen is 3D visualization of the elevator. Only there to look cool.
- Left panel is the outside control of the elevator.
- Right top panel is the inside control of the elevator.
- Step: Will stop autoplay, and run the simulation one step.
- Run: Will toggle autoplay, turned on by default. When autoplay is on, it will run simulation steps with a time delta.
- Reset: Resets the simulation to its initial state.
- All code is under src/index.ts.
- Search for ELEVATOR_LOGIC to see how elevator decides directioning, and serving requests.
- FLOOR_COUNT to change number of floors.
- TICK_DELTA_MS to change the delta time of simulation steps.