Skip to content

feat: Replace Player boolean flags with explicit state machine - #25

Merged
super3 merged 1 commit into
mainfrom
feature/player-state-machine
Mar 19, 2026
Merged

super3 merged 1 commit into
mainfrom
feature/player-state-machine

Conversation

@super3

@super3 super3 commented Mar 19, 2026

Copy link
Copy Markdown
Owner

Introduce PlayerStateMachine with 8 states (IDLE, WALKING, AUTOMATED_IDLE, AUTOMATED_WALKING, WALKING_TO_ELEVATOR, WAITING_FOR_ELEVATOR, IN_ELEVATOR, WALKING_THROUGH_DOOR) replacing 8+ scattered boolean flags (isWalking, waitingForElevator, inElevator, walkingThroughDoor, hasEnteredDoor, isIdling, playerCommandedMovement). Validated transitions prevent impossible state combinations.

Also fixes elevator boarding bug where door cooldown blocked the WALKING_THROUGH_DOOR → WAITING_FOR_ELEVATOR transition on floors with doors between the player and elevator.

Tests: 44 passing (up from 20).

Introduce PlayerStateMachine with 8 states (IDLE, WALKING, AUTOMATED_IDLE,
AUTOMATED_WALKING, WALKING_TO_ELEVATOR, WAITING_FOR_ELEVATOR, IN_ELEVATOR,
WALKING_THROUGH_DOOR) replacing 8+ scattered boolean flags (isWalking,
waitingForElevator, inElevator, walkingThroughDoor, hasEnteredDoor,
isIdling, playerCommandedMovement). Validated transitions prevent
impossible state combinations.

Also fixes elevator boarding bug where door cooldown blocked the
WALKING_THROUGH_DOOR → WAITING_FOR_ELEVATOR transition on floors with
doors between the player and elevator.

Tests: 44 passing (up from 20).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bitworld Ready Ready Preview, Comment Mar 19, 2026 6:46pm

@super3
super3 merged commit 9358e73 into main Mar 19, 2026
3 checks passed
@super3
super3 deleted the feature/player-state-machine branch March 19, 2026 18:47

This branch was successfully deployed

1 active deployment
Preview — 3c8f2eac Deployed Mar 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant