Skip to content

Instantly share code, notes, and snippets.

@strangeglyph
Created October 23, 2011 21:44
Show Gist options
  • Save strangeglyph/1307923 to your computer and use it in GitHub Desktop.
Save strangeglyph/1307923 to your computer and use it in GitHub Desktop.
public class FoodEntity extends Entity {
//The size of the entiy
public int size;
public FoodEntity() {
size = r.nextInt(100);
spawn(); //Warning: Overridable method call in constructor
}
public void spawn() {
this.x = r.nextInt(100);
this.y = r.nextInt(100);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment