From 7b416c205e86ed28c3fc5a97af74496a60cff3f8 Mon Sep 17 00:00:00 2001 From: rxbn_ Date: Fri, 13 Dec 2019 01:30:05 +0100 Subject: [PATCH] Field - game background as a constant --- src/break_out/Constants.java | 5 +++++ src/break_out/view/Field.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/break_out/Constants.java b/src/break_out/Constants.java index 46a9655..8e37ddf 100644 --- a/src/break_out/Constants.java +++ b/src/break_out/Constants.java @@ -74,6 +74,11 @@ public class Constants { */ public static final Double BALL_SPEED = 1.20; + /** + * The background color for the field + */ + public static final Color COLOR_GAME_BACKGROUND = new Color(33, 97, 138); + /** * The default component color */ diff --git a/src/break_out/view/Field.java b/src/break_out/view/Field.java index 942178c..eabd1d3 100644 --- a/src/break_out/view/Field.java +++ b/src/break_out/view/Field.java @@ -42,7 +42,7 @@ public class Field extends JPanel { super(); this.view = view; - this.background = new Color(177, 92, 107); + this.background = Constants.COLOR_GAME_BACKGROUND; setFocusable(true);