Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2010
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. package Game;
  2.  
  3. import java.awt.*;
  4.  
  5. import javax.swing.*;
  6.  
  7. public class Tile {
  8. Image tile;
  9. int x,y,height,width;
  10.  
  11.     public Tile(int x, int y){
  12.         ImageIcon tileTemp = new ImageIcon("src//Game//tile.png");
  13.         tile = tileTemp.getImage();
  14.         width = tileTemp.getIconWidth();
  15.         height = tileTemp.getIconHeight();
  16.        
  17.         this.x = x;
  18.         this.y = y;
  19.     }
  20.    
  21.     //get the Bounds of bullet for collision
  22.     public Rectangle getBounds(){
  23.         return new Rectangle(x,y,width,height);
  24.     }
  25.  
  26.     public int getY(){
  27.         return y;
  28.     }
  29.    
  30.     public int getX(){
  31.         return x;
  32.     }
  33.    
  34.     public Image getImage(){
  35.         return tile;
  36.     }
  37.    
  38.     public int getHeight(){
  39.         return height;
  40.     }
  41.  
  42.     public int getWidth(){
  43.         return width;
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement