crawl was redesigned to crwal1 and crawl2
This commit is contained in:
@@ -54,8 +54,20 @@ void render_loop(int speed) {
|
||||
}
|
||||
|
||||
if (uart_event == UartEvent::Triggered) {
|
||||
// start crawl frame for x time
|
||||
player_state.start_crawl();
|
||||
const char* msg = uart.get_message();
|
||||
PlayerState current = player_state.get_state();
|
||||
|
||||
if (msg && strstr(msg, "crawl2")) {
|
||||
// enter Crawl2 only if currently crawling in crawl1
|
||||
if (current == PlayerState::Crawl1)
|
||||
player_state.start_crawl(PlayerState::Crawl2);
|
||||
}
|
||||
else if (msg && strstr(msg, "crawl")) {
|
||||
// trigger normal crawl from walk/run
|
||||
if (current == PlayerState::Walk || current == PlayerState::Run)
|
||||
player_state.start_crawl(PlayerState::Crawl1);
|
||||
}
|
||||
|
||||
need_redraw = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user