Thanks for sharing.  I've also spent some time building a Common Lisp
game engine that uses a component architecture for the game objects.

For example in pong the player's paddle is made up of a visual,
physical and logical components.

(defun make-pong-player(side human sprite-def control-type name)
  (let ((phys (make-instance '2d-physics
                             :collide-type 'paddle :y *paddle-start-y* :width 
*paddle-
width* :height *paddle-height*))
;       (anim (make-instance 'animated-sprite :sprite-def sprite-def
;                            :current-frame 'frame-1 :speed 5.0))
        (visual (make-instance 'rectangle
                                  :w *paddle-width* :h *paddle-height*))
        (pong (make-instance 'player-paddle-logic
                             :control-type control-type :side side))
        (obj (make-instance 'composite-object :name name)))
    (add-component obj phys)
    (add-component obj visual)
;    (add-component obj anim)
    (add-component obj pong)
    obj))

The objects implement message handlers in order to operate. For
example the game engine sends update and draw messages. Users can
write their own message types with custom argument lists.

I've put the project on google code http://code.google.com/p/lisp-game-engine/

Although the pong game works I wouldn't consider this a finished
project by any means; it's more an experiment in game programming
using CL and the REPL.

It would require significant refactoring to make it work with Clojure
since I use mutable state a lot, but would certainly be possible.

Justin

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to