keymasterviriya1150

Test

Apr 18th, 2016
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. package Game    ;
  2.  
  3. import java.awt.Graphics2D;
  4. import java.awt.geom.Rectangle2D;
  5. import java.awt.geom.Rectangle2D.Double;
  6.  
  7.     public abstract class Sprite {
  8.             int x;
  9.             int y;
  10.             int width;
  11.             int height;
  12.  
  13.             public Sprite(int x, int y, int width, int height) {
  14.                     this.x = x;
  15.                     this.y = y;
  16.                     this.width = width;
  17.                     this.height = height;
  18.             }
  19.  
  20.             abstract public void draw(Graphics2D g);
  21.  
  22.             public Double getRectangle() {
  23.                     return new Rectangle2D.Double(x, y, width, height);
  24.             }
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment