From c21af90605fc1701147316944930f919d6a13150 Mon Sep 17 00:00:00 2001 From: rxbn_ Date: Fri, 13 Dec 2019 01:51:03 +0100 Subject: [PATCH] Ball - no blue colors according to constant GAME_BACKGROUND to prevent ghosting --- src/break_out/model/Ball.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/break_out/model/Ball.java b/src/break_out/model/Ball.java index 5d2f68b..d48751b 100644 --- a/src/break_out/model/Ball.java +++ b/src/break_out/model/Ball.java @@ -86,8 +86,9 @@ public class Ball implements IBall { public void newRandomColor() { Random random = new Random(); - // random hue without red colors - float hue = (random.nextInt(18000) + 6000) / 10000f; + // random hue without blue colors to prevent ghosting + // 65 <~ 170/255 + float hue = (random.nextInt(65)) / 100f; // saturation between 0.5 and 0.7 float saturation = (random.nextInt(2000) + 5000) / 10000f;