Simulation of an elevator and its passengers, written with PixiJS and Node+Parcel. Visit my website to view live demo at https://kamilluto.com/.
This code aims to simulate a real-world elevator and its passengers by only allowing passengers to interact with the elevator but not vice versa.
The elevator does not have access to any information about the passengers. The elevator only knows whether the door is still open due to being blocked, and what hall and console buttons were pressed. The passengers, however, can interact with the elevator, e.g.: press hall buttons, press elevator's console buttons, and hold the door.
The logic that control's elevtor's direction:
- Always continue moving up if the highest request is above.
- Only continue moving down if the lowest console request is below.
- When moving up, always stop at the console's requested floors.
- When moving down, always stop at the console and hall requests.
This logic simulates one old evelator that I used to ride when I was a kid.
Please share your feedback, thoughts, ideas, and recommendations on anything that I can do better. I'm still learning PixiJS, Parcel, Node, and JS really. It is a neverending journey, learning!
Added
- NaiveTalk (used for testing talk bubbles before a better talk system is implemented)
Added
- Implement sprite destruction.
- Implement responsive design via stage scaling.
Changed
- Make app global.
- Replace master container and use app.stage.addChild instead.
- Remove branding.
Fixed
- Fix loading PIXI as a global and as a module.
- Fix various syntax errors.
- Fix elevetor leaving before last boarding passenger's X-coordinate is on the elevator.
- Sprite interactivity (was missing the status box in v2.0.0 beta).
Added
Changed
- Transitioned code to PixiJS 8.0.
- Implemented Parcel/Node.
Fixed
- Removed onboading and exiting counts from the Elevator class because they disobeyed the game design rule.