~sebsite/generic-tetromino-game

when pressing right or left during the soft drop, cancel it. v2 PROPOSED

Lorenz (xha): 1
 when pressing right or left during the soft drop, cancel it.

 1 files changed, 6 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sebsite/generic-tetromino-game/patches/41764/mbox | git am -3
Learn more about email & git

[PATCH v2] when pressing right or left during the soft drop, cancel it. Export this patch

this replicates the behavior of nes tetris.
---
 main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/main.c b/main.c
index 07e9959..d13edcd 100644
--- a/main.c
+++ b/main.c
@@ -7608,7 +7608,12 @@ gameinput(const uint8_t inputs[static 4][2], uint8_t i)
				}
			} else if ((held & INPUT_MASK_DOWN) != 0
					&& g->softdrop > 0) {
				++g->softdrop;
				if  (pressed & (INPUT_MASK_RIGHT | INPUT_MASK_LEFT)) {
					/* cancel softdrop when left or right is pressed */
					g->softdrop = 0;
				} else {
					++g->softdrop;
				}
			} else if (pressed & INPUT_MASK_UP) {
				/* TODO */
			} else {
-- 
2.41.0
So I tested this, and this isn't entirely correct. In NES Tetris,
pressing left or right when holding down cancels the softdrop, but also
doesn't shift the piece (even if left/right is held down). Not sure how
easy/difficult this will be to implement, feel free to restructure some
stuff if it makes things cleaner.