File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,10 @@ int main() {
2929
3030 if (IsKeyDown (KEY_LEFT_SHIFT )) {
3131 action = -1 ;
32- if (IsKeyPressed (KEY_W ) || IsKeyPressed (KEY_UP )) action = UP ;
33- else if (IsKeyPressed (KEY_S ) || IsKeyPressed (KEY_DOWN )) action = DOWN ;
34- else if (IsKeyPressed (KEY_A ) || IsKeyPressed (KEY_LEFT )) action = LEFT ;
35- else if (IsKeyPressed (KEY_D ) || IsKeyPressed (KEY_RIGHT )) action = RIGHT ;
32+ if (IsKeyDown (KEY_W ) || IsKeyDown (KEY_UP )) action = UP ;
33+ else if (IsKeyDown (KEY_S ) || IsKeyDown (KEY_DOWN )) action = DOWN ;
34+ else if (IsKeyDown (KEY_A ) || IsKeyDown (KEY_LEFT )) action = LEFT ;
35+ else if (IsKeyDown (KEY_D ) || IsKeyDown (KEY_RIGHT )) action = RIGHT ;
3636 env .actions [0 ] = action - 1 ;
3737 } else if (frame % 1 != 0 ) {
3838 continue ;
@@ -47,7 +47,11 @@ int main() {
4747 if (action > 0 ) {
4848 c_step (& env );
4949 }
50-
50+
51+ if (IsKeyDown (KEY_LEFT_SHIFT ) && action > 0 ) {
52+ // Don't need to be super reactive
53+ WaitTime (0.1 );
54+ }
5155 }
5256
5357 free_linearlstm (net );
You can’t perform that action at this time.
0 commit comments