Small prototype game where you program the behavior of elevators in a building to load and unload building visitors.

Select the configuration of the building, each lift and button type as well as visitors arrival distribution curve, set a seed for repeatable simulation.

Create a mini LUA to program to direct the elevators and react to call requests and run/pause/restart the simulation to validate your logic.

In-game documentation, syntax highlighting and code snippets provided.

Built using Node+Vite+Typescript, using Wasmoon to run lua sandboxed, Phaser for the building and elevator 2D rendering and Monaco for the code editor and auto-completion features.

Lift Programmer Documentation

The simulation runs in cycles (ticks). Every tick, the `onTick` function in your script is called. You can use this function to check the state of the lifts and floors, and set new targets for the lifts.

1. Check lift status: Look at `building.lifts` to see where each lift is and if it's moving.

2. Assign targets: Use setLiftTargets(liftId, {floor1, floor2, ...}) to tell a lift where to go next.

3. Handle movement events: Implement `onLiftMoveStart` and `onLiftMoveEnd` for specific logic when a lift starts or stops.

4. Read the active lift requests at each floor or within the lift itself: Look at `building.floors[floorId].requests` and `building.lifts[liftId].requests` to see the active requests. The type of request depends on the type of button at this floor.

  • LUA [Documentation](https://www.lua.org/manual/5.4/)
  • LUA [Beginner's Guide](https://github.com/gridlocdev/lua-beginners-guide)
Published 4 days ago
StatusReleased
PlatformsHTML5
Release date 4 days ago
AuthorFire Biscuit Games
GenreSimulation
Made withPhaser
Tags2D, lua, Management, programming, Short
Average sessionA few minutes
LanguagesEnglish

Leave a comment

Log in with itch.io to leave a comment.