From ab10fcdf02afbd351006612c1f7371bdefdabf11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Sun, 25 Mar 2018 18:45:28 +0200 Subject: [PATCH] Reset simulation feature added. --- src/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.c b/src/main.c index 29ca322..1307e38 100644 --- a/src/main.c +++ b/src/main.c @@ -34,6 +34,7 @@ const char *help = "HELP:\n" "LEFT/RIGHT - turn the ship\n" "UP/DOWN - accelerate/decelerate\n" + "R - reset the simulation\n" "I - show/hide simulation information\n" "H - show/hide this help information\n" "Q/ESC - quit"; @@ -107,6 +108,8 @@ int main() { // only redraw or run simulation if the timer event has occurred if(redraw) { + if(key_is_down(KEY_RESET)) + ship_init(&ship, WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2); /* * We only run the simulation when the timer goes off so it's * running at a consistent rate, rather than dependent on random