Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 2nd, 2010  |  syntax: Java  |  size: 0.70 KB  |  views: 109  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }