okay you can run it now!
nix is nice still, i was doing something dumb
This commit is contained in:
parent
9095800378
commit
86806ff5a0
5 changed files with 11 additions and 8 deletions
|
@ -16,8 +16,9 @@
|
||||||
packages = forEachSupportedSystem ({ pkgs }: {
|
packages = forEachSupportedSystem ({ pkgs }: {
|
||||||
default = pkgs.writeShellScriptBin "mineschemer" ''
|
default = pkgs.writeShellScriptBin "mineschemer" ''
|
||||||
LD_LIBRARY_PATH="${pkgs.raylib}/lib" \
|
LD_LIBRARY_PATH="${pkgs.raylib}/lib" \
|
||||||
${pkgs.chez}/bin/scheme \
|
${pkgs.chez}/bin/scheme \
|
||||||
--script ${pkgs.writeText "main.scm" (builtins.readFile ./main.scm)} \
|
--script ${./main.scm} \
|
||||||
|
${./skins/classic.bmp} \
|
||||||
$@
|
$@
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
14
main.scm
14
main.scm
|
@ -690,7 +690,7 @@
|
||||||
; draw-game-over as a separate thing would be nice
|
; draw-game-over as a separate thing would be nice
|
||||||
|
|
||||||
; the game shows -99 when (- num-mines num-flagged) is less than -99
|
; the game shows -99 when (- num-mines num-flagged) is less than -99
|
||||||
(define (run-game mines width height seed)
|
(define (run-game mines width height seed skin-path)
|
||||||
(init-window (* width square-width) (* height square-width) "mineschemer")
|
(init-window (* width square-width) (* height square-width) "mineschemer")
|
||||||
(set-target-fps 60)
|
(set-target-fps 60)
|
||||||
|
|
||||||
|
@ -698,7 +698,7 @@
|
||||||
(newline)
|
(newline)
|
||||||
(random-seed seed)
|
(random-seed seed)
|
||||||
|
|
||||||
(let ([skin (load-skin "xp-flowers.bmp")]
|
(let ([skin (load-texture skin-path)]
|
||||||
[game (new-game mines width height)])
|
[game (new-game mines width height)])
|
||||||
;; (display skin)
|
;; (display skin)
|
||||||
;; (newline)
|
;; (newline)
|
||||||
|
@ -734,10 +734,12 @@
|
||||||
(time-nanosecond (current-time)))
|
(time-nanosecond (current-time)))
|
||||||
|
|
||||||
(unless (and
|
(unless (and
|
||||||
(>= 4 (length (command-line-arguments)) 3)
|
(pair? (command-line-arguments))
|
||||||
(for-all number? (map string->number (command-line-arguments))))
|
(>= 4 (length (cdr (command-line-arguments))) 3)
|
||||||
|
(for-all number? (map string->number (cdr (command-line-arguments)))))
|
||||||
(display "i need 3-4 numbers (MINES WIDTH HEIGHT SEED)")
|
(display "i need 3-4 numbers (MINES WIDTH HEIGHT SEED)")
|
||||||
(exit 1))
|
(exit 1))
|
||||||
|
|
||||||
(apply run-game (append (map string->number (command-line-arguments))
|
; i really need some actual arg parsing this is embarassing
|
||||||
(list (get-nano-seed))))
|
(apply run-game (append (map string->number (cdr (command-line-arguments)))
|
||||||
|
(list (get-nano-seed) (car (command-line-arguments)))))
|
||||||
|
|
BIN
skins/classic.bmp
Normal file
BIN
skins/classic.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.7 KiB |
BIN
skins/ewq-inverted-colors.bmp
Normal file
BIN
skins/ewq-inverted-colors.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
BIN
skins/xp-flowers.bmp
Normal file
BIN
skins/xp-flowers.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
Loading…
Reference in a new issue