Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.codef0x.snake;
- public class Food {
- int foodX;
- int foodY;
- public void spawn(int maxHeight, int maxWidth) {
- // todo Get size of board to spawn food properly
- this.foodX = (int) Math.ceil(Math.random() * maxHeight);
- this.foodY = (int) Math.ceil(Math.random() * maxWidth);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement