Last active
January 2, 2016 03:19
-
-
Save johnfredcee/8243349 to your computer and use it in GitHub Desktop.
Stub for CL-TCOD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defparameter *x* 45) | |
| (defparameter *y* 20) | |
| (defparameter *running* t) | |
| (defun main () | |
| (tcod:console-init-root 80 50 :title "Libtcod Lisp Tutorial" :fullscreen? nil :renderer :renderer-sdl) | |
| (loop | |
| while *running* | |
| do | |
| (tcod::console-clear tcod:*root*) | |
| (tcod::console-put-char tcod:*root* *x* *y* (char-code #\@) :set) | |
| (tcod::console-flush) | |
| (let ((events (tcod:sys-get-events))) | |
| (loop | |
| for e in events | |
| do | |
| (format t "~A~%" e) | |
| (case (car e) | |
| (:event-key-release (incf *x*)) | |
| (:event-key (incf *x*)) | |
| (:event-mouse-press (setf *running* nil))))))) | |
| (defun rerun () | |
| (setf *running* t) | |
| (main)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment