This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
java:objects [2015/02/05 10:01] gthanos |
java:objects [2015/02/05 10:06] gthanos |
||
---|---|---|---|
Line 66: | Line 66: | ||
public int getWidth() { | public int getWidth() { | ||
return width; | return width; | ||
+ | } | ||
+ | |||
+ | public int getArea() { | ||
+ | return width * height; | ||
} | } | ||
Line 71: | Line 75: | ||
public void move(int x, int y) { | public void move(int x, int y) { | ||
origin.setX( origin.getX() + x ); | origin.setX( origin.getX() + x ); | ||
- | origin.setY( origin.getY() + y ) | + | origin.setY( origin.getY() + y ); |
} | } | ||