Advertisement
Guest User

Untitled

a guest
May 24th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.awt.Graphics;
  3. import java.awt.Graphics2D;
  4. import java.awt.Image;
  5. import java.awt.RenderingHints;
  6. import java.io.Serializable;
  7. import java.net.MalformedURLException;
  8. import java.net.URL;
  9. import java.awt.image.BufferedImage;
  10.  
  11. import javax.swing.ImageIcon;
  12.  
  13. public class Bomb implements Serializable {
  14.  
  15. private int x, y;
  16.  
  17. public Bomb() { }
  18.  
  19. public void draw(Graphics g, int x, int y, BufferedImage icon) {
  20.  
  21. Graphics2D g2 = (Graphics2D) g;
  22. g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  23.  
  24. g2.setColor(Color.black);
  25. g.drawImage(icon, x, y, null);
  26.  
  27. }
  28.  
  29. public Location getLocation() {
  30. return new Location(x, y);
  31. }
  32.  
  33. public void place(Location loc) {
  34. x = loc.getX();
  35. y = loc.getY();
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement