keyhit.bmx 281 B

12345678910111213
  1. ' keyhit.bmx
  2. ' the following code draws a circle every time the
  3. ' program detects the spacebar has been pressed
  4. ' and exits when it detects the ESCAPE key has
  5. ' been pressed
  6. graphics 640,480
  7. while not keyhit(KEY_ESCAPE)
  8. cls
  9. if keyhit(KEY_SPACE) drawoval 0,0,640,480
  10. flip
  11. wend