same: spread the bonus out to last 20 cells and don't do the double-color thing

This commit is contained in:
Robby Findler 2011-01-10 20:47:10 -06:00
parent 45aa84b6ce
commit 070549101f
2 changed files with 20 additions and 24 deletions

View File

@ -17,7 +17,7 @@
(define colors (map (lambda (x) (make-object color% x)) (define colors (map (lambda (x) (make-object color% x))
(list "blue" "red" "brown" "forestgreen" "purple"))) (list "blue" "red" "brown" "forestgreen" "purple")))
(define pale-colors (map (λ (x) (define pale-colors (map (λ (x)
(define (paleize x) (- 255 (floor (/ (- 255 x) 2)))) (define (paleize x) (- 255 (floor (* (- 255 x) 1/2))))
(make-object color% (make-object color%
(paleize (send x red)) (paleize (send x red))
(paleize (send x green)) (paleize (send x green))
@ -67,15 +67,14 @@
(for ([v (in-vector v)]) (for ([v (in-vector v)])
(when (vector-ref v 0) (when (vector-ref v 0)
(set! cells-filled-in (+ cells-filled-in 1))))) (set! cells-filled-in (+ cells-filled-in 1)))))
(define bonus (if (<= cells-filled-in 10) (define bonus (if (<= cells-filled-in 20)
(* 100 (- 10 cells-filled-in)) (* 50 (- 20 cells-filled-in))
0)) 0))
(send score-message set-label (send score-message set-label
(format "~a + ~a = ~a" (format "~a + ~a = ~a"
clicked-score clicked-score
bonus bonus
(+ clicked-score bonus)))) (+ clicked-score bonus))))
(define same-canvas% (define same-canvas%
(class canvas% (class canvas%
@ -138,14 +137,9 @@
[mouse-clicked-x ;; has the mouse been clicked in a clickable place? [mouse-clicked-x ;; has the mouse been clicked in a clickable place?
(cond (cond
[(and mouse-over? mouse-clicked-over? multiple-cells?) [(and mouse-over? mouse-clicked-over? multiple-cells?)
(send dc set-pen
(list-ref colors color)
(* pen-size 2/3)
'solid)
(draw-blob blob i j)
(send dc set-pen (send dc set-pen
(list-ref pale-colors color) (list-ref pale-colors color)
(* pen-size 2/3 1/2) (* pen-size 2/3)
'solid) 'solid)
(draw-blob blob i j)] (draw-blob blob i j)]
[(and mouse-over? mouse-clicked-over?) [(and mouse-over? mouse-clicked-over?)
@ -161,14 +155,16 @@
'solid) 'solid)
(draw-blob blob i j)])] (draw-blob blob i j)])]
[else [else
(send dc set-pen (list-ref colors color) pen-size 'solid) (cond
(draw-blob blob i j) [mouse-over?
(when mouse-over? (send dc set-pen
(send dc set-pen (list-ref pale-colors color)
(list-ref pale-colors color) pen-size
(* pen-size 2/3) 'solid)
'solid) (draw-blob blob i j)]
(draw-blob blob i j))])) [else
(send dc set-pen (list-ref colors color) pen-size 'solid)
(draw-blob blob i j)])]))
(define (draw-blob blob i j) (define (draw-blob blob i j)
(define dc (get-dc)) (define dc (get-dc))
@ -408,7 +404,7 @@
(send canvas update-game-over) (send canvas update-game-over)
(reset-score) (reset-score)
(send canvas min-width (* board-width cell-w 2)) (send canvas min-width (* board-width cell-w 3))
(send canvas min-height (* board-height cell-h 2)) (send canvas min-height (* board-height cell-h 3))
(send frame show #t) (send frame show #t)
(void (yield semaphore)))) (void (yield semaphore))))

View File

@ -14,10 +14,10 @@ right will slide left to take up the empty column's space.
Your score increases for each ball removed from the board, in two ways. Your score increases for each ball removed from the board, in two ways.
First, when you remove a blob, you get as many points as the square of the number First, when you remove a blob, you get as many points as the square of the number
of cells the blob occupied, so removing bigger blobs is better. Second, if there of cells the blob occupied, so removing bigger blobs is better. Second, if there
are fewer than 10 cells occupied on the board, you get a bonus. are fewer than 20 cells occupied on the board, you get a bonus.
Specifically if you have 9 cells left, you Specifically if you have 19 cells left, you
get a 100 point bonus, 8 cells left yields a 200 point bonus, get a 50 point bonus, 18 cells left yields a 100 point bonus,
7 cells a 300 point bonus etc., and if there 17 cells a 150 point bonus etc., and if there
are no cells left, you get a 1000 point bonus. are no cells left, you get a 1000 point bonus.
Click the @onscreen{New Game} button to play again. Click the @onscreen{New Game} button to play again.