summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-06-29 19:22:15 -0400
committerrsiddharth <s@ricketyspace.net>2020-06-29 19:22:15 -0400
commitfa17fd85108aa349d26cb95d540ad0ba837ba32a (patch)
tree8d7ef77749d6a7b1a7863f102e105b1834371797 /net
parentd6541dc938905732cb4988d6dafff8ea2ab9f004 (diff)
fourteen: server.rkt: Update eat-all-the-things
Make a new cupcake appear on the screen every other time one is eaten.
Diffstat (limited to 'net')
-rw-r--r--net/ricketyspace/ror/fourteen/server.rkt4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ricketyspace/ror/fourteen/server.rkt b/net/ricketyspace/ror/fourteen/server.rkt
index c1d1e92..e551b2f 100644
--- a/net/ricketyspace/ror/fourteen/server.rkt
+++ b/net/ricketyspace/ror/fourteen/server.rkt
@@ -279,11 +279,13 @@ The server is responsible for:
;; determine left-over foods
(define (eat-all-the-things player foods)
(define b (ip-body player))
+ (define (new-cupcake)
+ (create-a-body CUPCAKE))
(for/fold ([foods '()]) ([f foods])
(cond
[(body-collide? f b)
(set-body-size! b (+ PLAYER-FATTEN-DELTA (body-size b)))
- foods]
+ (cons (new-cupcake) foods)]
[else (cons f foods)])))
;; body body -> Boolean