Skip to content

fix: hardDrop should use actual piece height, not fixed 4x4 matrix height#29

Open
SKYJAMES777 wants to merge 1 commit into
itssimmons:mainfrom
SKYJAMES777:fix/hard-drop
Open

fix: hardDrop should use actual piece height, not fixed 4x4 matrix height#29
SKYJAMES777 wants to merge 1 commit into
itssimmons:mainfrom
SKYJAMES777:fix/hard-drop

Conversation

@SKYJAMES777

Copy link
Copy Markdown

Bug

When a tetromino has empty rows at the bottom of its 4x4 bounding box,
the hard drop positions it incorrectly because it uses matrix.size() (always 4)
instead of the actual piece height.

Fix

Trim empty rows from the bottom of the bounding box before calculating
the drop position.

Fixes #3

AI disclosure: Codex (OpenAI) was used to accelerate this fix.

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.

[pending] hard drop it is not going all the way down if the piece grid (4x4) has empy rows at the end

1 participant