-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPreferences.java
More file actions
58 lines (50 loc) · 1.84 KB
/
Copy pathPreferences.java
File metadata and controls
58 lines (50 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.gradescope.spampede;
import java.awt.Color;
import java.awt.Font;
/**
* Represents settings for Spampede. Constants are stored in this file to avoid
* "magic strings" and "magic numbers".
*
* @author CS60 instructors
*/
final class Preferences {
/* ------- */
/* Timing */
/* ------ */
public static final int REFRESH_RATE = 2;
public static final int SPAM_ADD_RATE = 25;
public static final int SLEEP_TIME = 30; // milliseconds between updates
/* ------ */
/* Sizing */
/* ------ */
public static final int NUM_CELLS_WIDE = 50;
public static final int NUM_CELLS_TALL = 30;
public static final int CELL_SIZE = 10;
private static final int SPACE_FOR_BUTTONS = 190;
public static final int GAMEBOARDHEIGHT = NUM_CELLS_TALL * CELL_SIZE + SPACE_FOR_BUTTONS;
/* ------ */
/* Colors */
/* ------ */
public static final Color COLOR_BACKGROUND = Color.ORANGE;
public static final Color COLOR_WALL = Color.BLUE;
public static final Color COLOR_SPAM = Color.ORANGE;
public static final Color COLOR_OPEN = Color.WHITE;
public static final Color COLOR_HEAD = Color.BLACK;
public static final Color COLOR_BODY = Color.GREEN;
/* -------------------- */
/* Text display - Title */
/* -------------------- */
public static final int TITLE_X = 100;
public static final int TITLE_Y = 40;
public static final Font TITLE_FONT = new Font("Helvetica", Font.PLAIN, 30);
public static final Color TITLE_COLOR = Color.BLUE;
public static final String TITLE = "Spampede";
/* ------------------------ */
/* Text display - Game Over */
/* ------------------------ */
public static final int GAME_OVER_X = 150;
public static final int GAME_OVER_Y = 200;
public static final Font GAME_OVER_FONT = new Font("Helvetica", Font.PLAIN, 60);
public static final Color GAME_OVER_COLOR = Color.BLUE;
public static final String GAME_OVER_TEXT = "Game Over";
}