Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 18th, 2011  |  syntax: None  |  size: 0.93 KB  |  views: 74  |  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.  
  2. import java.awt.Color;
  3. import java.awt.Graphics;
  4. import java.awt.Image;
  5. import java.awt.Toolkit;
  6. import java.awt.image.BufferedImage;
  7. import java.io.File;
  8. import java.io.IOException;
  9. import javax.imageio.ImageIO;
  10. import javax.swing.ImageIcon;
  11.  
  12.  
  13. public class Player extends SpaceObject
  14.  
  15.  
  16. {
  17.  
  18.     private String name;
  19.     private int shield;
  20.     private int energySupply;
  21.    
  22.     //private Torpedo[] torpedo;
  23.     private int dmgDealt;
  24.     private boolean scannerDisabled, torpedoDisabled, phaserDisabled;
  25.    
  26.  
  27.     public Player()
  28.     {
  29.         hitpoints = 100;
  30.        
  31.     }
  32.  
  33.     @Override
  34.     void drawMe(Graphics g, int xCoor, int yCoor) {
  35.        
  36.           Image img = Toolkit.getDefaultToolkit().getImage("player.png");
  37.  
  38.  
  39.         //g.drawRect(xCoor, yCoor, 15, 15);
  40.         //g.setColor(Color.blue);
  41.        // g.fillRect(xCoor, yCoor, 15, 15);
  42.         g.drawImage(img, xCoor, yCoor, null);
  43.  
  44.  
  45.     }
  46.  
  47. }
clone this paste RAW Paste Data