comparison lisp/play/tetris.el @ 75482:d08d2bb89f98

(tetris-new-shape): Stop drawing if game is over.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 28 Jan 2007 19:39:58 +0000
parents e3694f1cb928
children 678584f358ef f83d17e1ace6
comparison
equal deleted inserted replaced
75481:2a056be108df 75482:d08d2bb89f98
360 (setq tetris-next-shape (random 7)) 360 (setq tetris-next-shape (random 7))
361 (setq tetris-pos-x (/ (- tetris-width (tetris-shape-width)) 2)) 361 (setq tetris-pos-x (/ (- tetris-width (tetris-shape-width)) 2))
362 (setq tetris-pos-y 0) 362 (setq tetris-pos-y 0)
363 (if (tetris-test-shape) 363 (if (tetris-test-shape)
364 (tetris-end-game) 364 (tetris-end-game)
365 (tetris-draw-shape)) 365 (tetris-draw-shape)
366 (tetris-draw-next-shape) 366 (tetris-draw-next-shape)
367 (tetris-update-score)) 367 (tetris-update-score)))
368 368
369 (defun tetris-draw-next-shape () 369 (defun tetris-draw-next-shape ()
370 (loop for y from 0 to 3 do 370 (loop for y from 0 to 3 do
371 (loop for x from 0 to 3 do 371 (loop for x from 0 to 3 do
372 (gamegrid-set-cell (+ tetris-next-x x) 372 (gamegrid-set-cell (+ tetris-next-x x)