Advertisement
Guest User

Food.java

a guest
Nov 15th, 2018
110
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.codef0x.snake;
  2.  
  3. public class Food {
  4.     int foodX;
  5.     int foodY;
  6.  
  7.     public void spawn(int maxHeight, int maxWidth) {
  8.         // todo Get size of board to spawn food properly
  9.         this.foodX = (int) Math.ceil(Math.random() * maxHeight);
  10.         this.foodY = (int) Math.ceil(Math.random() * maxWidth);
  11.     }
  12. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement