;;; tetris.el --- implementation of Tetris for Emacs
-;; Copyright (C) 1997, 2001-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2016 Free Software Foundation, Inc.
;; Author: Glynn Clements <glynn@sensei.co.uk>
;; Version: 2.01
(define-key map [left] 'tetris-move-left)
(define-key map [right] 'tetris-move-right)
(define-key map [up] 'tetris-rotate-prev)
- (define-key map [down] 'tetris-rotate-next)
+ (define-key map [down] 'tetris-move-down)
map))
(defvar tetris-null-map
(setq tetris-pos-x (1- tetris-pos-x)))
(tetris-draw-shape)))
+(defun tetris-move-down ()
+ "Move the shape one square to the bottom."
+ (interactive)
+ (unless tetris-paused
+ (tetris-erase-shape)
+ (setq tetris-pos-y (1+ tetris-pos-y))
+ (if (tetris-test-shape)
+ (setq tetris-pos-y (1- tetris-pos-y)))
+ (tetris-draw-shape)))
+
(defun tetris-rotate-prev ()
"Rotate the shape clockwise."
(interactive)