Optimized Ticking and Rendering #5

Merged
CyB3RC0nN0R merged 5 commits from feature/optimized_pipeline into develop 2020-07-01 20:17:13 +02:00
4 changed files with 92 additions and 100 deletions
Showing only changes of commit 5651ea76b0 - Show all commits

View File

@ -1,5 +1,7 @@
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
package dev.lh; package dev.lh;
import static java.awt.Color.*;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
import java.awt.*; import java.awt.*;
import java.util.Random; import java.util.Random;
@ -27,30 +29,56 @@ public class FoodFactory {
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @since Snake 1.0 * @since Snake 1.0
*/ */
public static enum Food { public static enum Food {
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
/** /**
* Use if white food is wanted. * Use if white food is wanted.
*/ */
white, white(
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
WHITE, 40
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
),
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
/** /**
* Use if yellow food is wanted. * Use if yellow food is wanted.
*/ */
yellow, yellow(
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
YELLOW, 15
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
),
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
/** /**
* Use if orange food is wanted. * Use if orange food is wanted.
*/ */
orange, orange(
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
ORANGE, 6
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
),
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
/** /**
* Use if red food is wanted. * Use if red food is wanted.
*/ */
red, red(
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
RED, 2
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
),
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
/** /**
* Use if blue food is wanted. * Use if blue food is wanted.
*/ */
blue blue(
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
BLUE, 1
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
);
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
/**
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* The color of the food item.
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
*/
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
public final Color color;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
/**
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* The length bonus of the food item.
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
*/
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
public final int lengthBonus;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
private Food(Color color, int lengthBonus) {
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
this.color = color;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
this.lengthBonus = lengthBonus;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
}
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
} }
private static FoodFactory foodFactory = new FoodFactory(); private static FoodFactory foodFactory = new FoodFactory();
@ -142,23 +170,7 @@ public class FoodFactory {
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @since Snake 1.0 * @since Snake 1.0
*/ */
public void colorOfFood(Graphics g) { public void colorOfFood(Graphics g) {
switch (nextFood) { g.setColor(nextFood.color);
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
case white:
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
g.setColor(Color.white);
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
break;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
case yellow:
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
g.setColor(Color.yellow);
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
break;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
case orange:
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
g.setColor(Color.orange);
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
break;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
case red:
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
g.setColor(Color.red);
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
break;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
case blue:
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
g.setColor(Color.blue);
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
break;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
}
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
} }
/** /**
@ -172,12 +184,12 @@ public class FoodFactory {
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
/** /**
* @param snakeHead the the head of a {@link Snake} object * @param snakeHead the the head of a {@link Snake} object
* @return true if the current food intersects with the snakehead * @return true if the current food intersects with the snake head
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @since Snake 1.0 * @since Snake 1.0
*/ */
public boolean checkCollision(Rectangle snakeHead) { public boolean checkCollision(Rectangle snakeHead) {
int s = rectangleSize * 5; int s = rectangleSize * 5;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
Rectangle food = new Rectangle(pFood, new Dimension(s, s)); Rectangle food = new Rectangle(pFood, new Dimension(s, s));
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
return food.intersects(snakeHead); return food.intersects(snakeHead);
} }
@ -186,24 +198,6 @@ public class FoodFactory {
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @since Snake 1.0 * @since Snake 1.0
*/ */
public int getAdditionalLength() { public int getAdditionalLength() {
int snakeAdditionalLength = 0; return nextFood.lengthBonus;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
switch (nextFood) {
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
case white:
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
snakeAdditionalLength = 40;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
break;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
case yellow:
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
snakeAdditionalLength = 15;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
break;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
case orange:
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
snakeAdditionalLength = 6;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
break;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
case red:
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
snakeAdditionalLength = 2;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
break;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
case blue:
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
snakeAdditionalLength = 1;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
break;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
}
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
return snakeAdditionalLength;
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
} }
} }

delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```

View File

@ -3,8 +3,8 @@ package dev.lh;
import java.awt.Graphics; import java.awt.Graphics;
/** /**
* This interface contains everything that needs to updated regularly.<br> * This interface contains everything that needs to be updated regularly.
* <br> * <p>
* Project: <strong>Snake</strong><br> * Project: <strong>Snake</strong><br>
* File: <strong>Updateable.java</strong><br> * File: <strong>Updateable.java</strong><br>
* Created: <strong>11 Mar 2020</strong><br> * Created: <strong>11 Mar 2020</strong><br>

View File

@ -20,9 +20,9 @@ public class Endscreen extends JDialog {
private static final long serialVersionUID = -4457484397259161063L; private static final long serialVersionUID = -4457484397259161063L;
private static final int goodOrBadResult = 200; private static final int goodOrBadResult = 200;
private final JPanel contentPanel = new JPanel(); private final JPanel contentPanel = new JPanel();
private final int score; private final int score;
/** /**
* Create the dialog. * Create the dialog.
@ -31,32 +31,33 @@ public class Endscreen extends JDialog {
*/ */
public Endscreen(int score) { public Endscreen(int score) {
this.score = score; this.score = score;
try { setTitle("Endscreen");
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setBounds(100, 100, 700, 700);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPanel.setLayout(new BorderLayout(0, 0));
getContentPane().add(contentPanel, BorderLayout.CENTER);
setTitle("Endscreen"); JButton btnNewButton = new JButton("Play again");
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); btnNewButton.setMnemonic(KeyEvent.VK_ENTER);
setBounds(100, 100, 700, 700); btnNewButton.addActionListener(e -> {
getContentPane().setLayout(new BorderLayout()); Main.startGame();
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); dispose();
contentPanel.setLayout(new BorderLayout(0, 0)); });
getContentPane().add(contentPanel, BorderLayout.CENTER); btnNewButton.setFont(new Font("Times New Roman", Font.PLAIN, 15));
contentPanel.add(btnNewButton, BorderLayout.SOUTH);
JButton btnNewButton = new JButton("Play again"); JLabel lblDeinPunktestand = new JLabel("Dein Punktestand: " + String.valueOf(score));
btnNewButton.setMnemonic(KeyEvent.VK_ENTER); lblDeinPunktestand.setFont(new Font("Times New Roman", Font.PLAIN, 25));
btnNewButton.addActionListener(e -> { Main.startGame(); dispose(); }); contentPanel.add(lblDeinPunktestand, BorderLayout.NORTH);
btnNewButton.setFont(new Font("Times New Roman", Font.PLAIN, 15));
contentPanel.add(btnNewButton, BorderLayout.SOUTH);
JLabel lblDeinPunktestand = new JLabel("Dein Punktestand: " + String.valueOf(score)); Image resultImage = Toolkit.getDefaultToolkit()
lblDeinPunktestand.setFont(new Font("Times New Roman", Font.PLAIN, 25)); .getImage(
contentPanel.add(lblDeinPunktestand, BorderLayout.NORTH); this.getClass()
.getResource((score < goodOrBadResult) ? "/Try_Again.jpg" : "/1211548-200.png")
Image resultImage = Toolkit.getDefaultToolkit() );
.getImage(this.getClass().getResource((score < goodOrBadResult) ? "/Try_Again.jpg" : "/1211548-200.png")); resultImage.flush();
resultImage.flush();
} catch (Exception e) {
e.printStackTrace();
}
} }
/** /**

View File

@ -21,13 +21,14 @@ import dev.lh.Main;
*/ */
public class StartScreen extends JFrame { public class StartScreen extends JFrame {
private static final long serialVersionUID = 6055940532003735543L; private static final long serialVersionUID = 6055940532003735543L;
private JPanel contentPane;
/** /**
* Closes the application. * Closes the application.
*/ */
public static void close() { System.exit(0); } public static void close() {
System.exit(0);
}
/** /**
* Launches Snake. * Launches Snake.
@ -43,31 +44,27 @@ public class StartScreen extends JFrame {
* Create the frame. * Create the frame.
*/ */
public StartScreen() { public StartScreen() {
try { setTitle("Snake - Startscreen");
// readInHighscores(); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setTitle("Snake - Startscreen"); setBounds(500, 200, 550, 550);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(500, 200, 550, 550);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
JButton buPlay = new JButton("Start Game"); JPanel contentPane = new JPanel();
buPlay.setBounds(158, 197, 190, 131); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
buPlay.setText("Play Again"); setContentPane(contentPane);
buPlay.setMnemonic(KeyEvent.VK_ENTER);
buPlay.setFont(new Font("Times New Roman", Font.PLAIN, 16)); JButton buPlay = new JButton("Start Game");
buPlay.addActionListener(a -> { buPlay.setBounds(158, 197, 190, 131);
Main.startGame(); buPlay.setText("Play Again");
setVisible(false); buPlay.setMnemonic(KeyEvent.VK_ENTER);
dispose(); buPlay.setFont(new Font("Times New Roman", Font.PLAIN, 16));
System.gc(); buPlay.addActionListener(a -> {
}); Main.startGame();
contentPane.add(buPlay); setVisible(false);
contentPane.setLayout(null); dispose();
setVisible(true); System.gc();
} catch (Exception e) { });
e.printStackTrace(); contentPane.add(buPlay);
} contentPane.setLayout(null);
setVisible(true);
} }
} }