diff options
Diffstat (limited to '03-wolfrand/src')
-rw-r--r-- | 03-wolfrand/src/main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/03-wolfrand/src/main.c b/03-wolfrand/src/main.c index b23cf81..e38dd56 100644 --- a/03-wolfrand/src/main.c +++ b/03-wolfrand/src/main.c @@ -88,12 +88,16 @@ int main(int argc, char **argv) case ALLEGRO_EVENT_KEY_DOWN: switch(e.keyboard.keycode) { + case ALLEGRO_KEY_Q: + goto done; + case ALLEGRO_KEY_1: - randomness = (randomness == 64 ? 4 : randomness * 2); + framerate = (framerate == 1 ? 8 : framerate / 2); + printf("fps: %.1f\n", FPS / ((float)framerate) ); break; case ALLEGRO_KEY_2: - framerate = (framerate == 1 ? 8 : framerate / 2); + randomness = (randomness == 64 ? 4 : randomness * 2); break; case ALLEGRO_KEY_UP: |