mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-06 11:55:48 +00:00
(tetris): New defgroup.
(tetris-use-glyphs, tetris-use-color, tetris-draw-border-with-glyphs) (tetris-default-tick-period): Convert to defcustom. Added * in docstring to indicate user variable. (tetris-update-speed-function, tetris-mode-hook, tetris-tty-colors) (tetris-x-colors, tetris-buffer-name, tetris-buffer-width) (tetris-buffer-height, tetris-width, tetris-height) (tetris-top-left-x, tetris-top-left-y): Convert to defcustom.
This commit is contained in:
parent
ab76d37680
commit
67ec1c1ab3
@ -1,3 +1,14 @@
|
|||||||
|
2002-01-23 Richard M. Stallman <rms@gnu.org>
|
||||||
|
|
||||||
|
* play/tetris.el: (tetris): New defgroup.
|
||||||
|
(tetris-use-glyphs, tetris-use-color, tetris-draw-border-with-glyphs)
|
||||||
|
(tetris-default-tick-period): Convert to defcustom.
|
||||||
|
Added * in docstring to indicate user variable.
|
||||||
|
(tetris-update-speed-function, tetris-mode-hook, tetris-tty-colors)
|
||||||
|
(tetris-x-colors, tetris-buffer-name, tetris-buffer-width)
|
||||||
|
(tetris-buffer-height, tetris-width, tetris-height)
|
||||||
|
(tetris-top-left-x, tetris-top-left-y): Convert to defcustom.
|
||||||
|
|
||||||
2002-01-22 Richard M. Stallman <rms@gnu.org>
|
2002-01-22 Richard M. Stallman <rms@gnu.org>
|
||||||
|
|
||||||
* bindings.el (mode-line-copied-mode-name): New variable.
|
* bindings.el (mode-line-copied-mode-name): New variable.
|
||||||
|
@ -35,60 +35,108 @@
|
|||||||
|
|
||||||
;; ;;;;;;;;;;;;; customization variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ;;;;;;;;;;;;; customization variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(defvar tetris-use-glyphs t
|
(defgroup tetris nil
|
||||||
"Non-nil means use glyphs when available.")
|
"Play a game of tetris."
|
||||||
|
:prefix "tetris-"
|
||||||
|
:group 'games)
|
||||||
|
|
||||||
(defvar tetris-use-color t
|
(defcustom tetris-use-glyphs t
|
||||||
"Non-nil means use color when available.")
|
"*Non-nil means use glyphs when available."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'boolean)
|
||||||
|
|
||||||
(defvar tetris-draw-border-with-glyphs t
|
(defcustom tetris-use-color t
|
||||||
"Non-nil means draw a border even when using glyphs.")
|
"*Non-nil means use color when available."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'boolean)
|
||||||
|
|
||||||
(defvar tetris-default-tick-period 0.3
|
(defcustom tetris-draw-border-with-glyphs t
|
||||||
"The default time taken for a shape to drop one row.")
|
"*Non-nil means draw a border even when using glyphs."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'boolean)
|
||||||
|
|
||||||
(defvar tetris-update-speed-function
|
(defcustom tetris-default-tick-period 0.3
|
||||||
|
"*The default time taken for a shape to drop one row."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'number)
|
||||||
|
|
||||||
|
(defcustom tetris-update-speed-function
|
||||||
'tetris-default-update-speed-function
|
'tetris-default-update-speed-function
|
||||||
"Function run whenever the Tetris score changes
|
"Function run whenever the Tetris score changes
|
||||||
Called with two arguments: (SHAPES ROWS)
|
Called with two arguments: (SHAPES ROWS)
|
||||||
SHAPES is the number of shapes which have been dropped
|
SHAPES is the number of shapes which have been dropped
|
||||||
ROWS is the number of rows which have been completed
|
ROWS is the number of rows which have been completed
|
||||||
|
|
||||||
If the return value is a number, it is used as the timer period.")
|
If the return value is a number, it is used as the timer period."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'function)
|
||||||
|
|
||||||
(defvar tetris-mode-hook nil
|
(defcustom tetris-mode-hook nil
|
||||||
"Hook run upon starting Tetris.")
|
"Hook run upon starting Tetris."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'hook)
|
||||||
|
|
||||||
(defvar tetris-tty-colors
|
(defcustom tetris-tty-colors
|
||||||
[nil "blue" "white" "yellow" "magenta" "cyan" "green" "red"]
|
[nil "blue" "white" "yellow" "magenta" "cyan" "green" "red"]
|
||||||
"Vector of colors of the various shapes in text mode
|
"Vector of colors of the various shapes in text mode
|
||||||
Element 0 is ignored.")
|
Element 0 is ignored."
|
||||||
|
:group 'tetris
|
||||||
|
:type (let ((names `("Shape 1" "Shape 2" "Shape 3"
|
||||||
|
"Shape 4" "Shape 5" "Shape 6" "Shape 7"))
|
||||||
|
(result `(vector (const nil))))
|
||||||
|
(while names
|
||||||
|
(add-to-list 'result
|
||||||
|
(cons 'choice
|
||||||
|
(cons :tag
|
||||||
|
(cons (car names)
|
||||||
|
(mapcar (lambda (color)
|
||||||
|
(list 'const color))
|
||||||
|
(defined-colors)))))
|
||||||
|
t)
|
||||||
|
(setq names (cdr names)))
|
||||||
|
result))
|
||||||
|
|
||||||
(defvar tetris-x-colors
|
(defcustom tetris-x-colors
|
||||||
[nil [0 0 1] [0.7 0 1] [1 1 0] [1 0 1] [0 1 1] [0 1 0] [1 0 0]]
|
[nil [0 0 1] [0.7 0 1] [1 1 0] [1 0 1] [0 1 1] [0 1 0] [1 0 0]]
|
||||||
"Vector of colors of the various shapes
|
"Vector of colors of the various shapes
|
||||||
Element 0 is ignored.")
|
Element 0 is ignored."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'sexp)
|
||||||
|
|
||||||
(defvar tetris-buffer-name "*Tetris*"
|
(defcustom tetris-buffer-name "*Tetris*"
|
||||||
"Name used for Tetris buffer.")
|
"Name used for Tetris buffer."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'string)
|
||||||
|
|
||||||
(defvar tetris-buffer-width 30
|
(defcustom tetris-buffer-width 30
|
||||||
"Width of used portion of buffer.")
|
"Width of used portion of buffer."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'number)
|
||||||
|
|
||||||
(defvar tetris-buffer-height 22
|
(defcustom tetris-buffer-height 22
|
||||||
"Height of used portion of buffer.")
|
"Height of used portion of buffer."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'number)
|
||||||
|
|
||||||
(defvar tetris-width 10
|
(defcustom tetris-width 10
|
||||||
"Width of playing area.")
|
"Width of playing area."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'number)
|
||||||
|
|
||||||
(defvar tetris-height 20
|
(defcustom tetris-height 20
|
||||||
"Height of playing area.")
|
"Height of playing area."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'number)
|
||||||
|
|
||||||
(defvar tetris-top-left-x 3
|
(defcustom tetris-top-left-x 3
|
||||||
"X position of top left of playing area.")
|
"X position of top left of playing area."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'number)
|
||||||
|
|
||||||
(defvar tetris-top-left-y 1
|
(defcustom tetris-top-left-y 1
|
||||||
"Y position of top left of playing area.")
|
"Y position of top left of playing area."
|
||||||
|
:group 'tetris
|
||||||
|
:type 'number)
|
||||||
|
|
||||||
(defvar tetris-next-x (+ (* 2 tetris-top-left-x) tetris-width)
|
(defvar tetris-next-x (+ (* 2 tetris-top-left-x) tetris-width)
|
||||||
"X position of next shape.")
|
"X position of next shape.")
|
||||||
|
Loading…
Reference in New Issue
Block a user