aboutsummaryrefslogtreecommitdiffstats
path: root/03-wolfrand
diff options
context:
space:
mode:
authorkatherine <ageha@airen-no-jikken.icu>2021-02-13 00:27:16 -0700
committerkatherine <ageha@airen-no-jikken.icu>2021-02-13 00:27:16 -0700
commit2ba834f1656faa1f7e8437f303caba5166a3b9eb (patch)
tree04c2a3d36fb29a8f631c6ea3acd2f05cc44ae24b /03-wolfrand
parent63e370da9e6bba79c5b561b6788ed5d6cf0b083e (diff)
downloadallegro-sketches-2ba834f1656faa1f7e8437f303caba5166a3b9eb.tar.gz
better input
Diffstat (limited to '03-wolfrand')
-rw-r--r--03-wolfrand/src/main.c8
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: