Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add falling block animation with <FallingBlock/> #52

Merged
merged 38 commits into from
Sep 9, 2022
Merged

Conversation

bytewife
Copy link
Member

@bytewife bytewife commented Sep 3, 2022

  • This issue adds a falling animation to board blocks that float above the ground, and to the player block when it the 'instant drop` action is performed.
    Note: Although slight non-deterministic behavior existed before this PR, it is more apparent now during the fall animations. This should be addressed in Remove non-determinism #51

@bytewife bytewife requested a review from kkysen September 3, 2022 17:23
@kkysen
Copy link
Member

kkysen commented Sep 3, 2022

Please format.

Copy link
Member

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the inline comments. I'll review the semantics more thoroughly later.

package.json Outdated Show resolved Hide resolved
src/GameLoop.tsx Outdated Show resolved Hide resolved
Comment on lines 140 to 146
export function dropFloatingCells(
board: BoardCell[][],
): [BoardCell[][], [number, number][], [number, number][]] {
): [BoardCell[][], BoardCell[], BoardCell[]] {
// Returns an array of 3 arrays:
// Array 1: The resulting board with drops.
// Array 1: The resulting board with the only old coords removed.
// Array 2: The array for the coords of the floating cells, post-drop.
// Array 3: Array for the old coords of the floating cells.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should just return an object with field names that describe their use instead of only putting that information in the documentation here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was talking about the return type. It shouldn't be a tuple with comments describing what each index means, it should be an object with self-describing fields.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean. That's a great change. Updated it again

src/GameLoop.tsx Outdated Show resolved Hide resolved
@kkysen
Copy link
Member

kkysen commented Sep 5, 2022

Lint and Format are still failing in CI, though.

@bytewife
Copy link
Member Author

bytewife commented Sep 6, 2022

I had forgotten to include src/components/FallingBlock.tsx. Added it now

@bytewife bytewife merged commit 1229504 into main Sep 9, 2022
@bytewife bytewife deleted the falling_block branch September 9, 2022 21:53
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.

2 participants