Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void setLocation(double x, double y) {
- _shape.setFrame(x, y, _shape.getWidth(), _shape.getHeight());
- if (_wrapping == true){
- _dpHeight = this.getHeight();
- _dpWidth = this.getWidth();
- double newX = ((x % _dpWidth) + _dpWidth) % _dpWidth;
- double newY = ((y % _dpHeight) + _dpHeight) % _dpHeight; //calculates mod
- this.setLocation(newX, newY);
- _shapeX = newX;
- _shapeY = newY;
- }
- }
Add Comment
Please, Sign In to add comment