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

Reset last_event exactly on a drop or fall. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jwg4
Copy link
Contributor

@jwg4 jwg4 commented Feb 25, 2016

The check for last event is used in two places. Firstly to check when we should repeat a soft drop if DOWN is held. Secondly to check when the block should stop being slidable and stick to the floor. In both cases, the exact condition should be changed to be that the block either fell itself or was dropped (either hard or soft). Currently the timer resets each time a key is pressed.

The soft drop should repeat if it has been enough time since the previous soft drop. Moving the block to the left or right (which can be done while DOWN is held) should not affect how fast the soft drops repeat. Therefore the time should not be reset on LEFT, RIGHT, ROTATE, etc. Resetting the timer on falls just means that the block will not occasionally "double drop" when a fall and a soft drop coincide. Resetting the timer on hard drops has no effect since after a hard drop there is no longer a possibility to soft drop.

When a block hits the floor, it is possible that it hasnt been actively moved for a while, but has been left to fall, with the player getting ready to "slide" it as soon as it hits the floor. If we do not reset the "last_event" timer for falls, then the block could instantly stick, because it has already been enough time since the last player action. Resetting the timer every time the block falls on its own avoids this. On the other hand, resetting the timer for each left or right movement means that a player can slide the block for an indefinite amount of time after it hits the floor, as long as they press the movement keys frequently enough, since each movement will reset the timer. For the same reason, DOWN presses should not reset the time unless they lead to an actual downward movement. These changes mean that the sliding time starts exactly when the block hits the floor.

The check for last event is used in two places. Firstly to check when we should repeat a soft drop if DOWN is held. Secondly to check when the block should stop being slidable and stick to the floor. In both cases, the exact condition is that the block either fell itself or was dropped (either hard or soft).

The soft drop should repeat if it has been enough time since the previous soft drop. Moving the block to the left or right (which can be done while DOWN is held) should not affect how fast the soft drops repeat. Therefore the time should not be reset on LEFT, RIGHT, ROTATE, etc. Resetting the timer on falls just means that the block will not occasionally "double drop" when a fall and a soft drop coincide. Resetting the timer on hard drops has no effect since after a hard drop there is no longer a possibility to soft drop.

When a block hits the floor, it is possible that it hasnt been actively moved for a while, but has been left to fall, with the player getting ready to "slide" it as soon as it hits the floor. If we do not reset the "last_event" timer for falls, then the block could instantly stick, because it has already been enough time since the last player action. Resetting the timer every time the block falls on its own avoids this. On the other hand, resetting the timer for each left or right movement means that a player can slide the block for an indefinite amount of time after it hits the floor, as long as they press the movement keys frequently enough, since each movement will reset the timer. For the same reason, DOWN presses should not reset the time unless they lead to an actual downward movement. These changes mean that the sliding time starts exactly when the block hits the floor.
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