From 8c22161119b7499746764a1ae2229257e2a38f16 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 13 Jun 2023 11:38:01 -0500 Subject: Update license to god willing license --- COPYING | 22 ++++++++-------------- README.md | 4 ++-- apple.scm | 44 +++++++++++++++++++++++--------------------- cover.png | Bin 0 -> 10427 bytes desc.txt | 11 +++++++++++ todo.txt | 13 +++++++++++++ 6 files changed, 57 insertions(+), 37 deletions(-) create mode 100644 cover.png create mode 100644 desc.txt create mode 100644 todo.txt diff --git a/COPYING b/COPYING index be17d92..26caa42 100644 --- a/COPYING +++ b/COPYING @@ -1,17 +1,11 @@ -Look at This Cool Rock I Found Public License Version 1.0 -Copyright (C) Case Duckworth +Copyright (C) Case Duckworth under the terms of the -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: + = = = = = = = = = = = = = GOD WILLING LICENSE v1.0 = = = = = = = = = = = = = = -1. You must agree to look at this cool rock I found[a]. Images of the cool rock - may be provided either as a URL or as an image in the source repository in - JPEG or WEBP format. GIF files may also be provided, but only in addition to - JPEG/WEBP. In the event that a URL is provided and the URL returns a 404 in - the future, the user may, at their discretion, provide a backup cool rock to - look at until such time as the URL is fixed. +Permission to use, distribute, modify, or otherwise interact with this software +is up to the good Lord, who in Their wisdom makes all things possible. I really +recommend you take it up with Them whether you should incorporate this software +into your project or not. -This software is provided "as is" and any express or implied warranties are -disclaimed, even if you do look at the rock. - -[a]: https://junk.acdw.net/coolrock.jpg \ No newline at end of file +This software comes with no warranties from the copyright holder; I cannot speak +for God. diff --git a/README.md b/README.md index 95b97b6..df51f1b 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ Run `./apple.scm` in this directory. Alternatively, run `make` to build a stati ## License -This software is licensed under the Look At This Cool Rock I Found Public License, version 1.0. See [COPYING][] for details. +This software is licensed under the God Willing License, version 1.0. See [COPYING][] for details. -Here is a picture of the cool rock I found: +Also, here is a picture of a cool rock I found: ![cool rock](https://junk.acdw.net/coolrock.jpg) diff --git a/apple.scm b/apple.scm index abc5b8d..0364cf4 100755 --- a/apple.scm +++ b/apple.scm @@ -21,7 +21,7 @@ See COPYING for details. (matchable) (stty)) -(define (log* . xs) +#;(define (log* . xs) (with-output-to-port (current-error-port) (lambda () (for-each (lambda (x) (display x) (display " ") x) @@ -45,17 +45,18 @@ See COPYING for details. game-cleanup))))) (define (game-exit-message msg) - (cond - ((eq? msg 'win) - (print "Congrats!") - #t) - ((eq? msg 'lose) - (print "Better luck next time.") - #t) - ((and (pair? msg) - (eq? (car msg) 'error)) - (apply error "An error occurred" (cdr error)) - #f))) + (cond ((and (pair? msg) + (eq? (car msg) 'error)) + (apply error "An error occurred" msg) + #f) + (else + (cond + ((eq? msg 'win) + (print "Congrats!")) + ((eq? msg 'lose) + (print "Better luck next time."))) + (print "Final score: " (score)) + #t))) ;;; Parameters (define me (make-parameter #f)) @@ -63,10 +64,11 @@ See COPYING for details. (define fruit (make-parameter #f)) (define world (make-parameter #f)) (define game-end (make-parameter #f)) +(define score (make-parameter 0)) (define fruits - (make-parameter (list (with-attrs '(yellow) ")") - (with-attrs '(green) "ò") + (make-parameter (list (with-attrs '(green) "ò") + (with-attrs '(yellow) ")") (with-attrs '(magenta) "%") (with-attrs '(blue) "*")))) @@ -110,7 +112,7 @@ See COPYING for details. (define (game-intro) (draw #<#END - #erase-screen + A P P L E! a Spring Lisp Game Jam 2023 entry by Case Duckworth @@ -325,7 +327,7 @@ END ;;; hacky-end (define (handle-collision a b) - (log* (thing-name a) (thing-name b)) + #;(log* (thing-name a) (thing-name b)) (cond ((or (and (me? a) (snake-head? b)) (and (snake-head? a) (me? b))) @@ -346,13 +348,13 @@ END #f) (thing-pos-randomize! (fruit)) (thing-look-set! (fruit) (random-choice (fruits))) - (snake-length-set! (snake) (+ (random-int 4 7) (snake-length (snake))))) + (snake-length-set! (snake) (+ (random-int 4 7) (snake-length (snake)))) + (score (+ 5 (score)))) (define (game-win) (draw (cursor-move 10 10) "YOU WIN! ") (sleep 1) - (flush-input) (readch) ((game-end) 'win)) @@ -360,7 +362,6 @@ END (draw (cursor-move 10 10) "YOU LOSE :( ") (sleep 1) - (flush-input) (readch) ((game-end) 'lose)) @@ -480,7 +481,8 @@ END (snake-length snake))) (for-each (lambda (t) (thing-place! t)) (snake-tail snake)) - (snake-mtime-set! snake now)))) + (snake-mtime-set! snake now) + (score (+ 1 (score)))))) (define (direction->velocity direction) (case direction @@ -563,7 +565,7 @@ END (snake-move-toward snake (fruit))) ;; Otherwise, move toward `me' (else (snake-move-toward snake (me)))))) - (unless (eq? direction new-dir) + #;(unless (eq? direction new-dir) (log* direction new-dir)) ;; Don't let the snake double back into itself (cond diff --git a/cover.png b/cover.png new file mode 100644 index 0000000..6c286e4 Binary files /dev/null and b/cover.png differ diff --git a/desc.txt b/desc.txt new file mode 100644 index 0000000..56da8ba --- /dev/null +++ b/desc.txt @@ -0,0 +1,11 @@ +A P P L E! a Spring Lisp Game Jam 2023 entry by Case Duckworth + +Welcome to APPLE, the game of SNAKE, except you're the apple instead! + +Specifically, you're the RED APPLE running from the SNAKE. He's hungry and looking for you! + +Luckily, you can distract him by going near other FRUIT #(fruits), which he'll eat instead of you, getting longer until he finally can't move and eat himself. + +Move using HJKL or arrow keys! Quit with Q, and pause with ESC. + +GOOD LUCK :D diff --git a/todo.txt b/todo.txt new file mode 100644 index 0000000..e2e0f66 --- /dev/null +++ b/todo.txt @@ -0,0 +1,13 @@ +# Todo for apple! + +- [x] Install an exception handler to ensure the game always returns the terminal correctly +- [x] Add intro/rules screen + - Could this be after the world is drawn in like, a "press any key to start" thing? + - [x] Write `flush-current-input-port' : + (define (flush-current-input-port) (if (char-ready?) (read-string))) + or something.. just to ensure that pending input doesn't do things + +- [ ] Score + - +1 every step + - +5 every fruit the snake eats? or +x, where x is how much the snake grows... + -- cgit 1.4.1-21-gabe81