Merge branch 'master' of github.com:cycojesus/emstar

This commit is contained in:
Gwenhael Le Moine 2011-07-10 17:14:07 +02:00
commit bde598f3ae

View file

@ -1,6 +1,6 @@
;;; emstar.el --- Emstar Game ;;; emstar.el --- Emstar Game
;; Copyright (C) 2008 Gwenhael Le Moine ;; Copyright © Gwenhael Le Moine
;; Author: Gwenhael Le Moine <gwenhael.le.moine@gmail.com> ;; Author: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
;; Keywords: games ;; Keywords: games
@ -25,6 +25,8 @@
;; Play Emstar in emacs. ;; Play Emstar in emacs.
;; Heavily based on emacs-sokoban ;; Heavily based on emacs-sokoban
;; (require 'emstar)
;;; Code: ;;; Code:
(require 'cl) (require 'cl)
@ -87,25 +89,30 @@ as saved in the playerfile."
:group 'emstar :group 'emstar
:type 'integer) :type 'integer)
(defcustom emstar-eater-char ?@ (defvar emstar-eater-char ?@)
"*Defines the character used to diplay the eater." (defvar emstar-gift-char ?*)
:group 'emstar (defvar emstar-stopper-char ?H)
:type 'character) (defvar emstar-wall-char ?#)
(defcustom emstar-gift-char ?* ;; (defcustom emstar-eater-char ?@
"*Defines the character used to diplay the gifts." ;; "*Defines the character used to diplay the eater."
:group 'emstar ;; :group 'emstar
:type 'character) ;; :type 'character)
(defcustom emstar-stopper-char ?H ;; (defcustom emstar-gift-char ?*
"*Defines the character used to diplay the stopper." ;; "*Defines the character used to diplay the gifts."
:group 'emstar ;; :group 'emstar
:type 'character) ;; :type 'character)
(defcustom emstar-wall-char ?# ;; (defcustom emstar-stopper-char ?H
"*Defines the character used to diplay the walls." ;; "*Defines the character used to diplay the stopper."
:group 'emstar ;; :group 'emstar
:type 'character) ;; :type 'character)
;; (defcustom emstar-wall-char ?#
;; "*Defines the character used to diplay the walls."
;; :group 'emstar
;; :type 'character)
(defface emstar-eater-face (defface emstar-eater-face
'((t (:foreground "green" '((t (:foreground "green"
@ -126,7 +133,7 @@ as saved in the playerfile."
:group 'emstar) :group 'emstar)
(defface emstar-wall-face (defface emstar-wall-face
'((t (:foreground "blue"))) '((t (:foreground "black")))
"*Face used display walls in emstar game." "*Face used display walls in emstar game."
:group 'emstar) :group 'emstar)
@ -168,6 +175,7 @@ as saved in the playerfile."
"Number of gifts collected. Buffer-local in emstar-mode.") "Number of gifts collected. Buffer-local in emstar-mode.")
(defvar emstar-total-gifts 0 (defvar emstar-total-gifts 0
"Total number of gifts. Buffer-local in emstar-mode.") "Total number of gifts. Buffer-local in emstar-mode.")
(defvar emstar-level nil (defvar emstar-level nil
"Number of current level. Buffer-local in emstar games.") "Number of current level. Buffer-local in emstar games.")
(defvar emstar-distance nil (defvar emstar-distance nil
@ -347,7 +355,7 @@ If requested level doesn't exist, load `emstar-start-level'."
(defun emstar-move-here () (defun emstar-move-here ()
"Move player to point. "Move player to point.
Move player char to point, repaint pits and evaluate game status." Move player char to point and evaluate game status."
(interactive) (interactive)
(setq emstar-pos (point)) (setq emstar-pos (point))
(emstar-paint (if (equal emstar-selected emstar-eater) (emstar-paint (if (equal emstar-selected emstar-eater)