Jelajahi Sumber

Messing around

Simon Watson 2 tahun lalu
induk
melakukan
70b81f683c
4 mengubah file dengan 50 tambahan dan 8 penghapusan
  1. 17 0
      ascii-assets.lisp
  2. 8 3
      clwars.lisp
  3. 25 4
      game.lisp
  4. 0 1
      structs.lisp

+ 17 - 0
ascii-assets.lisp

@@ -9,3 +9,20 @@
 ████████▀  █████▄▄██  ▀███▀███▀    ███    █▀    ███    ███  ▄████████▀  
            ▀                                    ███    ███              
 ")
+
+(defvar *intro-ship* "
+.        ,     . * -    .  .   , , . . -   *   . .
+    .       /        .       .           .  *     ,
+  *   , -     *    .    *      . _ .  ,   .   ,  .  .
+-  ,     .     ;  .   ,    ,,   .   .   *   .  .   .
+ .   *  ;   .   __________________   *   ,   .   +  
+*  ^   .  ,  * |              |   \ ., * .. . , . . -
+     . , * * * |              |____\
+     , . * * * |                   /
+             * |__________________/
+  ___             |   /
+/    \            |  /
+      \           | /---++
+      /           |/----++
+\ __ /
+")

+ 8 - 3
clwars.lisp

@@ -2,6 +2,9 @@
 (load "~/Repos/clwars/structs.lisp")
 (load "~/Repos/clwars/game.lisp")
 
+(defun reload()
+  (load "~/Repos/clwars/clwars.lisp"))
+
 ;; https://stackoverflow.com/questions/4882361/which-command-could-be-used-to-clear-screen-in-clisp
 (defun cls()
   (format t "~A[H~@*~A[J" #\escape))
@@ -13,6 +16,8 @@
 
 (defun main ()
   (format t *menu-splash*)
-  (format t "Press any key to start")
-  (prompt-read "")
-  (cls))
+  (format t "Press any key to start or q to quit: ")
+  (if (string-not-equal (prompt-read "") "q")
+      (progn
+	(cls)
+	(new-game))))

+ 25 - 4
game.lisp

@@ -35,7 +35,7 @@
 		      :credits 1000
 		      :crew (make-crew :sanity-val 100
 				       :moral-val 100
-				       :crew-members (list))
+				       :crew-members (list (make-uniq-crew-mem)))
 		      :inventory (make-player-inventory :petrofuel 20
 							:gruel 20
 							:spice 0
@@ -43,9 +43,30 @@
 							:archeotech 0)))))
 
 
+(defun new-game ()
+  (progn
+    (init-game-state))) 
 
+(defun game-intro ()
+  (cls)
+  (format t "In the grim darkness of the far future, there is only COMMERCE...~C" #\linefeed)
+  (sleep 2)
+  (format t "You embark across a bleak galaxy to ply your wares and discover untold riches!~C" #\linefeed)
+  (sleep 2)
+  (format t *intro-ship*)
+  (prompt-read ""))
 
+;; Options for top level menu
+(defvar *top-level-options* "
+Actions:
+1. Sector info
+2. Ship info
+3. Trade
+4. Scout
+5. Leave
+")
 
-
-
-
+(defun top-level-game-menu ()
+  (format t *top-level-options*)
+  (let ((option (prompt-read "Enter an option: "))
+	(cond ((eql option '"1") (print "1"))))))

+ 0 - 1
structs.lisp

@@ -50,4 +50,3 @@
   price-of-archeotech
   price-of-spice
   price-of-gruel)
-