Simplify FoodFactory#generateFoodLocation
This commit is contained in:
parent
9131d0e2fd
commit
7ca0a14ea2
@ -119,8 +119,7 @@ public class FoodFactory {
|
|||||||
public Point generateFoodLocation(int width, int height) {
|
public Point generateFoodLocation(int width, int height) {
|
||||||
assert (width > 100 && height > 100);
|
assert (width > 100 && height > 100);
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
pFood = new Point(r.nextInt(width - 100) + 50, r.nextInt(height - 100) + 50);
|
return pFood = new Point(r.nextInt(width - 100) + 50, r.nextInt(height - 100) + 50);
|
||||||
return pFood;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user