[GREENFOOT-130] add isInsideWorld method to World class api
isInsideWorld returns true if the given x and y location is inside the world and false if not. I find myself often needing this, say to check if an Actor is moving itself outside the World and so should remove itself.
Something like: {noformat} public boolean isInsideWorld(int x, int y) { return x >= 0 && x < getWidth() && y >= 0 && y < getHeight(); } {noformat}
Issue metadata
- Issue type: Task
- Priority: Lowest
- Fix versions: 3.0.0