same: spread the bonus out to last 20 cells and don't do the double-color thing
This commit is contained in:
parent
45aa84b6ce
commit
070549101f
|
@ -17,7 +17,7 @@
|
|||
(define colors (map (lambda (x) (make-object color% x))
|
||||
(list "blue" "red" "brown" "forestgreen" "purple")))
|
||||
(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%
|
||||
(paleize (send x red))
|
||||
(paleize (send x green))
|
||||
|
@ -67,15 +67,14 @@
|
|||
(for ([v (in-vector v)])
|
||||
(when (vector-ref v 0)
|
||||
(set! cells-filled-in (+ cells-filled-in 1)))))
|
||||
(define bonus (if (<= cells-filled-in 10)
|
||||
(* 100 (- 10 cells-filled-in))
|
||||
(define bonus (if (<= cells-filled-in 20)
|
||||
(* 50 (- 20 cells-filled-in))
|
||||
0))
|
||||
(send score-message set-label
|
||||
(format "~a + ~a = ~a"
|
||||
clicked-score
|
||||
bonus
|
||||
(+ clicked-score bonus))))
|
||||
|
||||
|
||||
(define same-canvas%
|
||||
(class canvas%
|
||||
|
@ -138,14 +137,9 @@
|
|||
[mouse-clicked-x ;; has the mouse been clicked in a clickable place?
|
||||
(cond
|
||||
[(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
|
||||
(list-ref pale-colors color)
|
||||
(* pen-size 2/3 1/2)
|
||||
(* pen-size 2/3)
|
||||
'solid)
|
||||
(draw-blob blob i j)]
|
||||
[(and mouse-over? mouse-clicked-over?)
|
||||
|
@ -161,14 +155,16 @@
|
|||
'solid)
|
||||
(draw-blob blob i j)])]
|
||||
[else
|
||||
(send dc set-pen (list-ref colors color) pen-size 'solid)
|
||||
(draw-blob blob i j)
|
||||
(when mouse-over?
|
||||
(send dc set-pen
|
||||
(list-ref pale-colors color)
|
||||
(* pen-size 2/3)
|
||||
'solid)
|
||||
(draw-blob blob i j))]))
|
||||
(cond
|
||||
[mouse-over?
|
||||
(send dc set-pen
|
||||
(list-ref pale-colors color)
|
||||
pen-size
|
||||
'solid)
|
||||
(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 dc (get-dc))
|
||||
|
@ -408,7 +404,7 @@
|
|||
|
||||
(send canvas update-game-over)
|
||||
(reset-score)
|
||||
(send canvas min-width (* board-width cell-w 2))
|
||||
(send canvas min-height (* board-height cell-h 2))
|
||||
(send canvas min-width (* board-width cell-w 3))
|
||||
(send canvas min-height (* board-height cell-h 3))
|
||||
(send frame show #t)
|
||||
(void (yield semaphore))))
|
||||
|
|
|
@ -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.
|
||||
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
|
||||
are fewer than 10 cells occupied on the board, you get a bonus.
|
||||
Specifically if you have 9 cells left, you
|
||||
get a 100 point bonus, 8 cells left yields a 200 point bonus,
|
||||
7 cells a 300 point bonus etc., and if there
|
||||
are fewer than 20 cells occupied on the board, you get a bonus.
|
||||
Specifically if you have 19 cells left, you
|
||||
get a 50 point bonus, 18 cells left yields a 100 point bonus,
|
||||
17 cells a 150 point bonus etc., and if there
|
||||
are no cells left, you get a 1000 point bonus.
|
||||
|
||||
Click the @onscreen{New Game} button to play again.
|
||||
|
|
Loading…
Reference in New Issue
Block a user