109 |
|
|
110 |
;; ;;;;;;;;;;;;; display options ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;;;;;;;;;;;;; display options ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
111 |
|
|
|
(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)))) |
|
|
|
|
112 |
(defvar tetris-blank-options |
(defvar tetris-blank-options |
113 |
'(((glyph colorize) |
'(((glyph colorize) |
114 |
(t ?\040)) |
(t ?\040)) |
115 |
((color-x color-x) |
((color-x color-x) |
116 |
(mono-x grid-x) |
(mono-x grid-x) |
117 |
(color-tty color-tty) |
(color-tty color-tty)) |
|
(t nil)) |
|
118 |
(((glyph color-x) [0 0 0]) |
(((glyph color-x) [0 0 0]) |
119 |
(color-tty "black") |
(color-tty "black")))) |
|
(t nil)))) |
|
120 |
|
|
121 |
(defvar tetris-cell-options |
(defvar tetris-cell-options |
122 |
'(((glyph colorize) |
'(((glyph colorize) |
125 |
((color-x color-x) |
((color-x color-x) |
126 |
(mono-x mono-x) |
(mono-x mono-x) |
127 |
(color-tty color-tty) |
(color-tty color-tty) |
128 |
(mono-tty mono-tty) |
(mono-tty mono-tty)) |
|
(t nil)) |
|
129 |
;; color information is taken from tetris-x-colors and tetris-tty-colors |
;; color information is taken from tetris-x-colors and tetris-tty-colors |
130 |
)) |
)) |
131 |
|
|
132 |
|
(defvar tetris-border-options |
133 |
|
'(((glyph colorize) |
134 |
|
(t ?\+)) |
135 |
|
((color-x color-x) |
136 |
|
(mono-x grid-x) |
137 |
|
(color-tty color-tty)) |
138 |
|
(((glyph color-x) [0.5 0.5 0.5]) |
139 |
|
(color-tty "white")))) |
140 |
|
|
141 |
(defvar tetris-space-options |
(defvar tetris-space-options |
142 |
'(((t ?\040)) |
'(((t ?\040)) |
143 |
nil |
nil |
181 |
[[0 0 0 0] [7 0 0 0] [0 0 0 0] [7 0 0 0]] |
[[0 0 0 0] [7 0 0 0] [0 0 0 0] [7 0 0 0]] |
182 |
[[0 0 0 0] [7 0 0 0] [0 0 0 0] [7 0 0 0]]]]) |
[[0 0 0 0] [7 0 0 0] [0 0 0 0] [7 0 0 0]]]]) |
183 |
|
|
184 |
;;the scoring rules were taken from "xtetris". Blocks score differently |
;;the scoring rules were taken from "xtetris". Blocks score differently |
185 |
;;depending on their rotation |
;;depending on their rotation |
186 |
|
|
187 |
(defconst tetris-shape-scores |
(defconst tetris-shape-scores |
188 |
[ [6 6 6 6] [6 7 6 7] [6 7 6 7] [6 7 6 7] [6 7 6 7] [5 5 6 5] [5 8 5 8]] ) |
[ [6 6 6 6] [6 7 6 7] [6 7 6 7] [6 7 6 7] [6 7 6 7] [5 5 6 5] [5 8 5 8]] ) |
189 |
|
|
190 |
(defconst tetris-shape-dimensions |
(defconst tetris-shape-dimensions |
437 |
(tetris-shift-down) |
(tetris-shift-down) |
438 |
(setq tetris-n-shapes (1+ tetris-n-shapes)) |
(setq tetris-n-shapes (1+ tetris-n-shapes)) |
439 |
(setq tetris-score |
(setq tetris-score |
440 |
(+ tetris-score |
(+ tetris-score |
441 |
(aref (aref tetris-shape-scores tetris-shape) tetris-rot))) |
(aref (aref tetris-shape-scores tetris-shape) tetris-rot))) |
442 |
(tetris-update-score) |
(tetris-update-score) |
443 |
(tetris-new-shape)) |
(tetris-new-shape)) |