This commit is contained in:
zongor 2023-10-31 19:11:35 -04:00
parent d637a3b411
commit 514fef5b7a
6 changed files with 63 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,13 @@
# Lisp MMO Project Implementation
The interesting thing about lisp is that for being the 2nd oldest language, it has some of the most flavors of any programming language.
Lisp is much easier to implement from a compiler/interpreter point of view due to its structure, so it makes sense that it has so many implementations.
[We are spoiled for choice for this challenge.](https://github.com/dundalek/awesome-lisp-languages)
[lisp-µhttpd (game website & webserver) ](./www/README.md)
[lisp-mmo-server (game backend) using picolisp](./server/README.md)
[lisp-mmo-client (game frontend / UI) using common lisp](./client/README.md)

0
lisp/client/README.md Normal file
View File

50
lisp/client/client.rkt Normal file
View File

@ -0,0 +1,50 @@
#!/usr/bin/env racket
#lang racket/base
(module+ main
(require raylib/generated/unsafe)
(define (sync-camera camera camera_pos target_pos)
(set-Camera3D-target! camera target_pos)
(set-Vector3-x! camera_pos (Vector3-x target_pos))
(set-Vector3-y! camera_pos (+ (Vector3-y target_pos) 10.0))
(set-Vector3-z! camera_pos (+ (Vector3-z target_pos) 10.0))
(set-Camera3D-position! camera camera_pos))
(define (move-user camera pos scale)
(when (IsKeyDown KEY_RIGHT)
(set-Vector3-x! pos (+ (Vector3-x (Camera3D-target camera)) scale)))
(when (IsKeyDown KEY_LEFT)
(set-Vector3-x! pos (- (Vector3-x (Camera3D-target camera)) scale)))
(when (IsKeyDown KEY_UP)
(set-Vector3-z! pos (- (Vector3-z (Camera3D-target camera)) scale)))
(when (IsKeyDown KEY_DOWN)
(set-Vector3-z! pos (+ (Vector3-z (Camera3D-target camera)) scale))))
(InitWindow 800 450 "racket lisp client : raylib")
(define camera_pos (make-Vector3 0.0 12.0 14.0))
(define target_pos (make-Vector3 0.0 2.0 0.0))
(define camera (make-Camera3D camera_pos target_pos (make-Vector3 0.0 1.0 0.0) 60.0 CAMERA_PERSPECTIVE))
(SetTargetFPS 60)
(let loop ()
(when (not (WindowShouldClose))
(BeginDrawing)
(ClearBackground RAYWHITE)
(move-user camera target_pos 0.2)
(sync-camera camera camera_pos target_pos)
(BeginMode3D camera)
(DrawGrid 30 1.0)
(DrawCube (Camera3D-target camera) 0.5 0.5 0.5 PURPLE)
(EndMode3D)
(EndDrawing)
(loop)))
(CloseWindow))

0
lisp/server/README.md Normal file
View File

0
lisp/www/README.md Normal file
View File