diff --git a/Military-Hero-Core/src/com/annimon/militaryhero/SniperAim.java b/Military-Hero-Core/src/com/annimon/militaryhero/SniperAim.java index 2e0e276..f252997 100644 --- a/Military-Hero-Core/src/com/annimon/militaryhero/SniperAim.java +++ b/Military-Hero-Core/src/com/annimon/militaryhero/SniperAim.java @@ -9,6 +9,7 @@ import com.annimon.jecp.Image; public class SniperAim { private final Image aim; + private final int aimWidth, aimHeight; private final int width, height; private int x, y; @@ -16,11 +17,20 @@ public class SniperAim { this.width = width; this.height = height; aim = ImageLoader.load(ImageLoader.SNIPER_AIM); - x = (width - aim.getWidth()) / 2; - y = (height - aim.getHeight()) / 2; + aimWidth = aim.getWidth(); + aimHeight = aim.getHeight(); + x = (width - aimWidth) / 2; + y = (height - aimHeight) / 2; } public void draw(Graphics g) { g.drawImage(aim, x, y); + g.setColor(0xFF000000); + final int bottom = y + aimHeight; + g.fillRect(0, 0, width, y); + g.fillRect(0, bottom, width, height - bottom); + final int right = x + aim.getWidth(); + g.fillRect(0, y, x, aimHeight); + g.fillRect(right, y, width - right, aimHeight); } }