Function: tetris-update-game

tetris-update-game is a byte-compiled function defined in tetris.el.gz.

Signature

(tetris-update-game TETRIS-BUFFER)

Documentation

Called on each clock tick.

Drops the shape one square, testing for collision.

Source Code

;; Defined in /usr/src/emacs/lisp/play/tetris.el.gz
(defun tetris-update-game (tetris-buffer)
  "Called on each clock tick.
Drops the shape one square, testing for collision."
  (if (and (not tetris-paused)
	   (eq (current-buffer) tetris-buffer))
      (let (hit)
	(tetris-erase-shape)
	(setq tetris-pos-y (1+ tetris-pos-y))
	(setq hit (tetris-test-shape))
	(if hit
	    (setq tetris-pos-y (1- tetris-pos-y)))
	(tetris-draw-shape)
	(if hit
	    (tetris-shape-done)))))