|
@ -1,7 +1,7 @@ |
|
|
package Snake; |
|
|
package Snake; |
|
|
|
|
|
|
|
|
import java.awt.Point; |
|
|
import java.awt.Point; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.concurrent.ThreadLocalRandom; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class Apple |
|
|
public class Apple |
|
@ -14,4 +14,11 @@ public class Apple |
|
|
this.position = new Point(0, 0); |
|
|
this.position = new Point(0, 0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void selectGridPosition(int gridSize) |
|
|
|
|
|
{ |
|
|
|
|
|
int x = ThreadLocalRandom.current().nextInt(0, gridSize); |
|
|
|
|
|
int y = ThreadLocalRandom.current().nextInt(0, gridSize); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |