File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,13 @@ private void Update()
72
72
73
73
private void HandleMoveInputs ( )
74
74
{
75
- this . moveTime = Time . time + this . moveDelay ;
76
-
77
75
// Soft drop movement
78
- if ( Input . GetKey ( KeyCode . S ) ) {
79
- Move ( Vector2Int . down ) ;
76
+ if ( Input . GetKey ( KeyCode . S ) )
77
+ {
78
+ if ( Move ( Vector2Int . down ) ) {
79
+ // Update the step time to prevent double movement
80
+ this . stepTime = Time . time + this . stepDelay ;
81
+ }
80
82
}
81
83
82
84
// Left/right movement
@@ -91,11 +93,8 @@ private void Step()
91
93
{
92
94
this . stepTime = Time . time + this . stepDelay ;
93
95
94
- // Do not move down if the player is already holding down
95
- // otherwise it can cause a double movement
96
- if ( ! Input . GetKey ( KeyCode . S ) ) {
97
- Move ( Vector2Int . down ) ;
98
- }
96
+ // Step down to the next row
97
+ Move ( Vector2Int . down ) ;
99
98
100
99
// Once the piece has been inactive for too long it becomes locked
101
100
if ( this . lockTime >= this . lockDelay ) {
@@ -131,6 +130,7 @@ private bool Move(Vector2Int translation)
131
130
if ( valid )
132
131
{
133
132
this . position = newPosition ;
133
+ this . moveTime = Time . time + this . moveDelay ;
134
134
this . lockTime = 0f ; // reset
135
135
}
136
136
You can’t perform that action at this time.
0 commit comments