From af7077b07a7994c50ac0e255362b486197ab66b3 Mon Sep 17 00:00:00 2001 From: Paul Dino Jones Date: Tue, 25 Apr 2023 10:33:05 +0000 Subject: [PATCH] Adding velocity to test function --- src/monocoque/gameloop/gameloop.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/monocoque/gameloop/gameloop.c b/src/monocoque/gameloop/gameloop.c index 326afbf..6ceff9f 100644 --- a/src/monocoque/gameloop/gameloop.c +++ b/src/monocoque/gameloop/gameloop.c @@ -255,6 +255,7 @@ int tester(SimDevice* devices, int numdevices) fprintf(stdout, "\n"); simdata->gear = 0; + simdata->velocity = 16; simdata->rpms = 100; simdata->maxrpm = 8000; sleep(3); @@ -275,6 +276,14 @@ int tester(SimDevice* devices, int numdevices) } sleep(3); + fprintf(stdout, "Setting speed to 100\n"); + simdata->velocity = 100; + for (int x = 0; x < numdevices; x++) + { + devices[x].update(&devices[x], simdata); + } + sleep(3); + fprintf(stdout, "Shifting into second gear\n"); simdata->gear = 2; for (int x = 0; x < numdevices; x++) @@ -283,6 +292,14 @@ int tester(SimDevice* devices, int numdevices) } sleep(3); + fprintf(stdout, "Setting speed to 200\n"); + simdata->velocity = 200; + for (int x = 0; x < numdevices; x++) + { + devices[x].update(&devices[x], simdata); + } + sleep(3); + fprintf(stdout, "Shifting into third gear\n"); simdata->gear = 3; for (int x = 0; x < numdevices; x++) @@ -315,6 +332,14 @@ int tester(SimDevice* devices, int numdevices) } sleep(3); + fprintf(stdout, "Setting speed to 300\n"); + simdata->velocity = 300; + for (int x = 0; x < numdevices; x++) + { + devices[x].update(&devices[x], simdata); + } + sleep(3); + fprintf(stdout, "Setting rpms to 8000\n"); simdata->rpms = 8000; for (int x = 0; x < numdevices; x++) @@ -323,6 +348,7 @@ int tester(SimDevice* devices, int numdevices) } sleep(3); + simdata->velocity = 0; simdata->rpms = 100; for (int x = 0; x < numdevices; x++) {