Arne Babenhauserheide  committed 1b95fc4

typing: Added next level info.

  • Participants
  • Parent commits 7d458cd
  • Branches fluss

Comments (0)

Files changed (1)

File libs/typing.el

   :type '(repeat string)
   :group 'typing-of-emacs)
+(defcustom toe-next-level-messages 
+  '("Next Level: Get them!" "Next Level: Frag 'em!")
+  "Messages printed after a wrong answer."
+  :type '(repeat string)
+  :group 'typing-of-emacs)
 (defcustom toe-buffer-name "*The Typing Of Emacs*"
   "Name of the game buffer.
 Note that if the name starts and ends with `*', the buffer
       (dtk-speak feedback))
     (insert " - " feedback)))
+(defun toe-next-level ()
+  "Give next level encouragement."
+  ; TODO: also state the current level
+  (toe-feedback toe-next-level-messages))
 ;; Only way to get out of the game
 (defun toe-score (letters words start end)
 		  words (delete word words)))
 	;; If next level is reached, force finding of new words.
 	(if (>= level-word-count toe-words-per-level)
-	    (setq level-word-count 0
-		  words nil))))
+        (progn
+          (toe-next-level)
+          (setq level-word-count 0
+                words nil)))))
     (toe-score letter-count total-word-count game-start (current-time))))
 (provide 'typing)