Skip to content

Commit

Permalink
fix test-tetris.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
ktpss95112 committed Aug 17, 2024
1 parent 1fea50c commit ad1b11e
Showing 1 changed file with 39 additions and 41 deletions.
80 changes: 39 additions & 41 deletions fw/Core/Hitcon/App/test-tetris.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,48 +92,46 @@ void ioFunction() {
}
}

if (std::fgetc(stdin) != EOF) {
char ch = std::fgetc(stdin);
switch (ch) {
case 'a': {
std::lock_guard<std::mutex> lock(game_mutex);
game.game_on_input(hitcon::tetris::DIRECTION_LEFT);
break;
}

case 'd': {
std::lock_guard<std::mutex> lock(game_mutex);
game.game_on_input(hitcon::tetris::DIRECTION_RIGHT);
break;
}

case 's': {
std::lock_guard<std::mutex> lock(game_mutex);
game.game_on_input(hitcon::tetris::DIRECTION_DOWN);
break;
}

case 'w': {
std::lock_guard<std::mutex> lock(game_mutex);
game.game_on_input(hitcon::tetris::DIRECTION_UP);
break;
}

case 't': {
std::lock_guard<std::mutex> lock(game_mutex);
game.game_enemy_attack(2);
break;
}

case 'f': {
std::lock_guard<std::mutex> lock(game_mutex);
game.game_on_input(hitcon::tetris::DIRECTION_FAST_DOWN);
break;
}

default:
break;
char ch = std::fgetc(stdin);
switch (ch) {
case 'a': {
std::lock_guard<std::mutex> lock(game_mutex);
game.game_on_input(hitcon::tetris::DIRECTION_LEFT);
break;
}

case 'd': {
std::lock_guard<std::mutex> lock(game_mutex);
game.game_on_input(hitcon::tetris::DIRECTION_RIGHT);
break;
}

case 's': {
std::lock_guard<std::mutex> lock(game_mutex);
game.game_on_input(hitcon::tetris::DIRECTION_DOWN);
break;
}

case 'w': {
std::lock_guard<std::mutex> lock(game_mutex);
game.game_on_input(hitcon::tetris::DIRECTION_UP);
break;
}

case 't': {
std::lock_guard<std::mutex> lock(game_mutex);
game.game_enemy_attack(2);
break;
}

case 'f': {
std::lock_guard<std::mutex> lock(game_mutex);
game.game_on_input(hitcon::tetris::DIRECTION_FAST_DOWN);
break;
}

default:
break;
}
}
}
Expand Down

0 comments on commit ad1b11e

Please sign in to comment.