From 87742d81570d767b528b39ea54a0b12cbc96d315 Mon Sep 17 00:00:00 2001 From: Nicolas Glondu Date: Sun, 6 Nov 2011 11:16:22 +0100 Subject: [PATCH] ghosts now blink at the end of bonus --- src/ghost.opa | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ghost.opa b/src/ghost.opa index f7687d0..f54a811 100644 --- a/src/ghost.opa +++ b/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)