diff options
Diffstat (limited to 'net/ricketyspace/ror/six')
-rw-r--r-- | net/ricketyspace/ror/six/resources/goo-red.gif | bin | 0 -> 681 bytes | |||
-rw-r--r-- | net/ricketyspace/ror/six/snake.rkt | 13 |
2 files changed, 9 insertions, 4 deletions
diff --git a/net/ricketyspace/ror/six/resources/goo-red.gif b/net/ricketyspace/ror/six/resources/goo-red.gif Binary files differnew file mode 100644 index 0000000..bf767b1 --- /dev/null +++ b/net/ricketyspace/ror/six/resources/goo-red.gif diff --git a/net/ricketyspace/ror/six/snake.rkt b/net/ricketyspace/ror/six/snake.rkt index d894de5..24e5cea 100644 --- a/net/ricketyspace/ror/six/snake.rkt +++ b/net/ricketyspace/ror/six/snake.rkt @@ -21,6 +21,7 @@ (define MT-SCENE (empty-scene WIDTH-PX HEIGHT-PX)) (define GOO-IMG (bitmap "resources/goo.gif")) +(define GOO-RED-IMG (bitmap "resources/goo-red.gif")) (define SEG-IMG (bitmap "resources/body.gif")) (define HEAD-IMG (bitmap "resources/head.gif")) @@ -185,11 +186,15 @@ snake-body-scene)) (define (goo-list+scene goos scene) - (define (get-posns-from-goo goos) + (define (get-posns-from-goo goos type) (cond [(empty? goos) empty] - [else (cons (goo-loc (first goos)) - (get-posns-from-goo (rest goos)))])) - (img-list+scene (get-posns-from-goo goos) GOO-IMG scene)) + [(= (goo-type (first goos)) type) + (cons (goo-loc (first goos)) + (get-posns-from-goo (rest goos) type))] + [else (get-posns-from-goo (rest goos) type)])) + (img-list+scene (get-posns-from-goo goos 1) GOO-IMG + (img-list+scene (get-posns-from-goo goos 2) + GOO-RED-IMG scene))) (define (img-list+scene posns img scene) (cond [(empty? posns) scene] |