diff --git a/demos/01-demo.lisp b/demos/01-demo.lisp index ef97946..6130a39 100644 --- a/demos/01-demo.lisp +++ b/demos/01-demo.lisp @@ -80,22 +80,22 @@ (>= (* (car head-cell) segment-size) display-width) (>= (* (cadr head-cell) segment-size) display-height) (self-collision)) - (fill-style cx :red) - (font-style cx "bold 20px sans-serif") + (setf (fill-style cx) :red + (font-style cx) "bold 20px sans-serif") (fill-text cx "GAME OVER" 30 30) (play-media (create-audio body :source "/demo/game-over.wav" :controls nil)) (setf game-over t)) (t - (fill-style cx :purple) + (setf (fill-style cx) :purple) (push head-cell (snake app)) (dolist (cell (snake app)) (draw-segment cell)) - (fill-style cx :white) + (setf (fill-style cx) :white) (cond ((equal head-cell (food app)) (fill-text cx (format nil "Score: ~A" (score app)) 5 (- display-height 15)) (setf (score app) (+ (score app) 10)) - (fill-style cx :green) + (setf (fill-style cx) :green) (fill-text cx (format nil "Score: ~A" (score app)) 5 (- display-height 15)) (play-media (create-audio body :source "/demo/eat.wav" :controls nil)) @@ -103,7 +103,7 @@ (t (draw-segment (car (last (snake app)))) (setf (snake app) (butlast (snake app))))) - (fill-style cx :brown) + (setf (fill-style cx) :brown) (draw-segment (food app)))) game-over))) @@ -152,8 +152,8 @@ (dotimes (n initial-length) (push (list n 0) (snake app))) (setf context (create-context2d disp)) - (font-style context "normal 20px sans-serif") - (fill-style context :green) + (setf (font-style context) "normal 20px sans-serif" + (fill-style context) :green) (fill-text context (format nil "Score: ~A" (score app)) 5 (- display-height 15)) (set-on-key-down body #'on-key-down :disable-default t)