some minor fixes
This commit is contained in:
parent
5c97eb3db4
commit
4ff33ecdf2
@ -1,3 +1,5 @@
|
||||
import frames.FrameBattleship;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Main {
|
||||
|
@ -1,3 +1,8 @@
|
||||
package drawing_objects;
|
||||
|
||||
import entities.EntityBattleship;
|
||||
import enums.DirectionType;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class DrawingBattleship {
|
||||
@ -86,7 +91,9 @@ public class DrawingBattleship {
|
||||
graphics2D.drawRect(startPosX + 70, startPosY + 12, 18, 26);
|
||||
graphics2D.drawOval(startPosX + 94, startPosY + 19, 12, 12);
|
||||
//блоки
|
||||
drawingBlocks.drawBlocks(graphics2D, startPosX, startPosY);
|
||||
if (drawingBlocks != null){
|
||||
drawingBlocks.drawBlocks(graphics2D, startPosX, startPosY);
|
||||
}
|
||||
//орудийная башня
|
||||
if (entityBattleship.getTurret()) {
|
||||
int[] shieldX = new int[] {startPosX + 112, startPosX + 112, startPosX + 119, startPosX + 119, };
|
@ -1,3 +1,7 @@
|
||||
package drawing_objects;
|
||||
|
||||
import enums.BlocksNumber;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class DrawingBlocks {
|
@ -1,3 +1,5 @@
|
||||
package entities;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.function.Supplier;
|
||||
|
@ -1,3 +1,5 @@
|
||||
package enums;
|
||||
|
||||
public enum BlocksNumber {
|
||||
TWO,
|
||||
FOUR,
|
@ -1,3 +1,5 @@
|
||||
package enums;
|
||||
|
||||
public enum DirectionType {
|
||||
UP,
|
||||
DOWN,
|
@ -1,3 +1,8 @@
|
||||
package frames;
|
||||
|
||||
import drawing_objects.DrawingBattleship;
|
||||
import enums.DirectionType;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@ -5,6 +10,7 @@ import java.awt.event.ActionEvent;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Random;
|
||||
|
||||
public class FrameBattleship extends JFrame {
|
||||
private DrawingBattleship drawingBattleship;
|
||||
private JComponent pictureBox;
|
Loading…
Reference in New Issue
Block a user