Skip to content

Commit 2ec81ca

Browse files
Michael BalasMichael Balas
authored andcommitted
Edit Documentation
Revised documentation for Game.java by fixing grammatical errors and removing redundancies.
1 parent 20c635f commit 2ec81ca

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/com/redomar/game/Game.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public void init() {
352352
}
353353
}
354354

355-
screen = new Screen(WIDTH, HEIGHT, new SpriteSheet("/sprite_sheet.png")); // Loads a new screen with a width, height, and SpriteSheet
355+
screen = new Screen(WIDTH, HEIGHT, new SpriteSheet("/sprite_sheet.png"));
356356
input = new InputHandler(this); // Input begins to record key presses
357357
setMouse(new MouseHandler(this)); // Mouse tracking and clicking is now recorded
358358
setWindow(new WindowHandler(this));
@@ -395,7 +395,7 @@ public void run() {
395395
init(); // Initialize the game environment
396396

397397
while (Game.isRunning()) { // Keep looping until game ends
398-
long now = System.nanoTime(); // Current time to used check against lastTime (time has passed since entering the loop)
398+
long now = System.nanoTime(); // Current time used to check against lastTime (time has passed since entering the loop)
399399
delta += (now - lastTime) / nsPerTick; // Elapsed time in seconds multiplied by 60
400400
lastTime = now; // Update the lastTime to the current time (now)
401401
boolean shouldRender = false;
@@ -526,10 +526,10 @@ public void render() {
526526
- ("Press Q to quit".length() * 3), getHeight() - 17);
527527
}
528528
g.setColor(Color.YELLOW);
529-
g.drawString(time.getTime(), (getWidth() - 58), (getHeight() - 3)); // Display the current time in yellow in the bottom right corner of the screen (hh:mm:ss)
529+
g.drawString(time.getTime(), (getWidth() - 58), (getHeight() - 3)); // Displays the current time in yellow in the bottom right corner of the screen (hh:mm:ss)
530530
g.setColor(Color.GREEN);
531531
if(backgroundMusic.getActive()) { // If music is turned on
532-
g.drawString("MUSIC is ON ", 3, getHeight() - 3); // Display "MUSIC IS ON" in green in the bottom left corner of the screen.
532+
g.drawString("MUSIC is ON ", 3, getHeight() - 3); // Displays "MUSIC IS ON" in green in the bottom left corner of the screen.
533533
}
534534
g.dispose(); // Frees up memory and resources for graphics
535535
bs.show(); // Shows contents of buffer
@@ -543,18 +543,18 @@ private void status(Graphics g, boolean TerminalMode, boolean TerminalQuit) {
543543
if (TerminalMode == true) { // If running in developer mode
544544
g.setColor(Color.CYAN);
545545
g.drawString("JavaGame Stats", 0, 10); // Display "JavaGame Stats" in cyan at the bottom left of the screen
546-
g.drawString("FPS/TPS: " + fps + "/" + tps, 0, 25); // Display the FPS and TPS directly above "JavaGame Stats"
546+
g.drawString("FPS/TPS: " + fps + "/" + tps, 0, 25); // Display the FPS and TPS in cyan directly above "JavaGame Stats"
547547
if ((player.getNumSteps() & 15) == 15) {
548548
steps += 1;
549549
}
550-
g.drawString("Foot Steps: " + steps, 0, 40); // Display the number of "Foot Steps" (above the previous)
550+
g.drawString("Foot Steps: " + steps, 0, 40); // Display the number of "Foot Steps" (in cyan, above the previous)
551551
g.drawString(
552-
"NPC: " + WordUtils.capitalize(String.valueOf(isNpc())), 0, // Displays whether the NPC is on the level (above the previous)
552+
"NPC: " + WordUtils.capitalize(String.valueOf(isNpc())), 0, // Displays whether the NPC is on the level (in cyan, above the previous)
553553
55);
554-
g.drawString("Mouse: " + getMouse().getX() + "x |" // Displays the position of the cursor (above the previous)
554+
g.drawString("Mouse: " + getMouse().getX() + "x |" // Displays the position of the cursor (in cyan, above the previous)
555555
+ getMouse().getY() + "y", 0, 70);
556556
if (getMouse().getButton() != -1) // If a mouse button is pressed (1, 2, or 3)
557-
g.drawString("Button: " + getMouse().getButton(), 0, 85); // Displays the button that is pressed (above the previous)
557+
g.drawString("Button: " + getMouse().getButton(), 0, 85); // Displays the button that is pressed (in cyan, above the previous)
558558
g.setColor(Color.CYAN);
559559
g.fillRect(getMouse().getX() - 12, getMouse().getY() - 12, 24, 24);
560560
}
@@ -564,7 +564,7 @@ private void status(Graphics g, boolean TerminalMode, boolean TerminalQuit) {
564564
g.setColor(Color.RED);
565565
g.drawString("Shutting down the Game", (getWidth() / 2) - 70, // Display "Shutting down the Game" in red in the middle of the screen
566566
(getHeight() / 2) - 8);
567-
g.dispose(); // Free up memory
567+
g.dispose(); // Free up memory for graphics
568568
}
569569
}
570570

0 commit comments

Comments
 (0)