CLOG Extra 7 - Quick Start a Game with CLOG Builder
Вставка
- Опубліковано 11 вер 2024
- Code shown:
```
(defun on-key-down (panel target data)
(let ((key (getf data :key))
(x (position-left (image-3 panel)))
(y (position-top (image-3 panel))))
(cond ((or (equalp key "ArrowLeft") (equalp key "a"))
(set-styles (image-3 panel) `(("transition" "all 1s") ("transform" "rotate(90deg)")))
(setf (left (image-3 panel)) (unit "px" (- x 10))))
((or (equalp key "ArrowUp") (equalp key "w"))
(set-styles (image-3 panel) `(("transition" "all 1s") ("transform" "rotate(180deg)")))
(setf (top (image-3 panel)) (unit "px" (- y 10))))
((or (equalp key "ArrowDown") (equalp key "s"))
(set-styles (image-3 panel) `(("transition" "all 1s") ("transform" "rotate(0deg)")))
(setf (top (image-3 panel)) (unit "px" (+ y 10))))
((or (equalp key "ArrowRight") (equalp key "d"))
(set-styles (image-3 panel) `(("transition" "all 1s") ("transform" "rotate(270deg)")))
(setf (left (image-3 panel)) (unit "px" (+ x 5)))))))
```
Dear Rabbi Botton,
thanx for all the interesting stuff and information! Your CLOG videos got me interested in websockets. But I am not sure, if CLOG is right for me. Do you hve any information about the basic architecture of CLOG? There ar lots of dependencies for CLOG, and I am not sure if I want to deal with all that. I prefer very few dependencies and a simple structure. Can CLOG be used in that manner or is all the stuff really required? Can it be used in a stripped down manner? Send messages back nd forth and that's it? Basically?
Thank you very much for your attention!
Marc Rohrer
You can use create-element and stuff any HTML you want etc. CLOG has no dependencies really, so not following. With the exception of clog-connection-websocket they can be easily switched out it is all straight common lisp
@@DavidBotton Thanx!