(use-modules (gacela))
+(define counter-quit #f)
+(let ((n 0))
+ (set! counter-quit
+ (lambda ()
+ (set! n (+ n 1))
+ (format #t "Quit clicked ~a times !!~%" n)
+ (if (> n 2)
+ (stop-game)))))
+
(display-scene
(window ((resolution '(640 480))
- (when-quit (lambda () (format #t "Quit clicked!!~%"))))
- (bitmap "x.bmp")))
+ (when-quit counter-quit))
+ (image "x.bmp")))