480 } |
480 } |
481 |
481 |
482 // player rotation |
482 // player rotation |
483 // TODO: queue up to two movement commands (for sharp 90° turns) |
483 // TODO: queue up to two movement commands (for sharp 90° turns) |
484 if (asc_key_pressed(ASC_KEY(LEFT))) { |
484 if (asc_key_pressed(ASC_KEY(LEFT))) { |
485 if (spaceship->direction != MOVE_RIGHT) { |
485 if (player->direction != MOVE_RIGHT) { |
486 spaceship->target_direction = MOVE_LEFT; |
486 player->target_direction = MOVE_LEFT; |
487 } |
487 } |
488 } |
488 } |
489 if (asc_key_pressed(ASC_KEY(RIGHT))) { |
489 if (asc_key_pressed(ASC_KEY(RIGHT))) { |
490 if (spaceship->direction != MOVE_LEFT) { |
490 if (player->direction != MOVE_LEFT) { |
491 spaceship->target_direction = MOVE_RIGHT; |
491 player->target_direction = MOVE_RIGHT; |
492 } |
492 } |
493 } |
493 } |
494 if (asc_key_pressed(ASC_KEY(UP))) { |
494 if (asc_key_pressed(ASC_KEY(UP))) { |
495 if (spaceship->direction != MOVE_DOWN) { |
495 if (player->direction != MOVE_DOWN) { |
496 spaceship->target_direction = MOVE_UP; |
496 player->target_direction = MOVE_UP; |
497 } |
497 } |
498 } |
498 } |
499 if (asc_key_pressed(ASC_KEY(DOWN))) { |
499 if (asc_key_pressed(ASC_KEY(DOWN))) { |
500 if (spaceship->direction != MOVE_UP) { |
500 if (player->direction != MOVE_UP) { |
501 spaceship->target_direction = MOVE_DOWN; |
501 player->target_direction = MOVE_DOWN; |
502 } |
502 } |
503 } |
503 } |
504 |
504 |
505 // debug-key for clearing the shader registry |
505 // debug-key for clearing the shader registry |
506 if (asc_key_pressed(ASC_KEY(S))) { |
506 if (asc_key_pressed(ASC_KEY(S))) { |