Skip to content
Browse files

ghosts now blink at the end of bonus

  • Loading branch information...
1 parent c063b85 commit 87742d81570d767b528b39ea54a0b12cbc96d315 @HenJi HenJi committed Nov 6, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/ghost.opa
View
10 src/ghost.opa
@@ -143,9 +143,15 @@
draw(g, ctx:Canvas.context) =
ghosts = match g.on_steroids with
| {none} -> List.map(_.f2, g.ghosts)
- | {some=_} ->
+ | {some={~cycles combo=_}} ->
+ default = (scared_color, scared_eye_color)
+ inverted = (scared_eye_color, scared_color)
+ (color, eye_color) =
+ if cycles > 104 then default
+ else if mod(cycles, 30) > 15 then default
+ else inverted
List.map(
- g -> {g.f2 with color=scared_color eye_color=scared_eye_color},
+ g -> {g.f2 with ~color ~eye_color},
g.ghosts)
List.iter(draw_one(ctx, _), ghosts)

0 comments on commit 87742d8

Please sign in to comment.
Something went wrong with that request. Please try again.