]> code.delx.au - gnu-emacs/blobdiff - lisp/play/tetris.el
Merge from gnus--rel--5.10
[gnu-emacs] / lisp / play / tetris.el
index ea4025cdee4e7a1d0a56326ed21d2425519f22c0..53305a08e66b1e257ae09229be75066dd9da2006 100644 (file)
@@ -1,6 +1,7 @@
 ;;; tetris.el --- implementation of Tetris for Emacs
 
-;; Copyright (C) 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005,
+;;   2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Glynn Clements <glynn@sensei.co.uk>
 ;; Version: 2.01
@@ -21,8 +22,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -160,25 +161,14 @@ Element 0 is ignored."
 
 ;; ;;;;;;;;;;;;; display options ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(defvar tetris-border-options
-  '(((glyph colorize)
-     (t ?\+))
-    ((color-x color-x)
-     (mono-x grid-x)
-     (t nil))
-    (((glyph color-x) [0.5 0.5 0.5])
-     (t nil))))
-
 (defvar tetris-blank-options
   '(((glyph colorize)
      (t ?\040))
     ((color-x color-x)
      (mono-x grid-x)
-     (color-tty color-tty)
-     (t nil))
+     (color-tty color-tty))
     (((glyph color-x) [0 0 0])
-     (color-tty "black")
-     (t nil))))
+     (color-tty "black"))))
 
 (defvar tetris-cell-options
   '(((glyph colorize)
@@ -187,11 +177,19 @@ Element 0 is ignored."
     ((color-x color-x)
      (mono-x mono-x)
      (color-tty color-tty)
-     (mono-tty mono-tty)
-     (t nil))
+     (mono-tty mono-tty))
     ;; color information is taken from tetris-x-colors and tetris-tty-colors
     ))
 
+(defvar tetris-border-options
+  '(((glyph colorize)
+     (t ?\+))
+    ((color-x color-x)
+     (mono-x grid-x)
+     (color-tty color-tty))
+    (((glyph color-x) [0.5 0.5 0.5])
+     (color-tty "white"))))
+
 (defvar tetris-space-options
   '(((t ?\040))
     nil
@@ -364,9 +362,9 @@ Element 0 is ignored."
   (setq tetris-pos-y 0)
   (if (tetris-test-shape)
       (tetris-end-game)
-    (tetris-draw-shape))
-  (tetris-draw-next-shape)
-  (tetris-update-score))
+    (tetris-draw-shape)
+    (tetris-draw-next-shape)
+    (tetris-update-score)))
 
 (defun tetris-draw-next-shape ()
   (loop for y from 0 to 3 do
@@ -604,22 +602,23 @@ tetris-mode keybindings:
   (setq major-mode 'tetris-mode)
   (setq mode-name "Tetris")
 
-  (setq mode-popup-menu
-       '("Tetris Commands"
-         ["Start new game"     tetris-start-game]
-         ["End game"           tetris-end-game
-          (tetris-active-p)]
-         ["Pause"              tetris-pause-game
-          (and (tetris-active-p) (not tetris-paused))]
-         ["Resume"             tetris-pause-game
-          (and (tetris-active-p) tetris-paused)]))
+  (unless (featurep 'emacs)
+    (setq mode-popup-menu
+         '("Tetris Commands"
+           ["Start new game"   tetris-start-game]
+           ["End game"         tetris-end-game
+            (tetris-active-p)]
+           ["Pause"            tetris-pause-game
+            (and (tetris-active-p) (not tetris-paused))]
+           ["Resume"           tetris-pause-game
+            (and (tetris-active-p) tetris-paused)])))
 
   (setq gamegrid-use-glyphs tetris-use-glyphs)
   (setq gamegrid-use-color tetris-use-color)
 
   (gamegrid-init (tetris-display-options))
 
-  (run-hooks 'tetris-mode-hook))
+  (run-mode-hooks 'tetris-mode-hook))
 
 ;;;###autoload
 (defun tetris ()
@@ -649,4 +648,5 @@ tetris-mode keybindings:
 
 (provide 'tetris)
 
+;;; arch-tag: fb780d53-3ff0-49f0-8e19-f7f13cf2d49e
 ;;; tetris.el ends here