diff --git a/ProjectAirFighter/src/CollectionGenericObjects/Constructor.java b/ProjectAirFighter/src/CollectionGenericObjects/Constructor.java index 80ba521..a60ef3f 100644 --- a/ProjectAirFighter/src/CollectionGenericObjects/Constructor.java +++ b/ProjectAirFighter/src/CollectionGenericObjects/Constructor.java @@ -21,7 +21,7 @@ public class Constructor { public DrawningAirCraft getRandomAirCraft() { Random rnd = new Random(); - int entityIndex = rnd.nextInt(0, 2); + int entityIndex = rnd.nextInt(0, 3); int engineIndex = rnd.nextInt(0, 3); T entity = entitiesList.get(entityIndex); diff --git a/ProjectAirFighter/src/Drawnings/DrawningAirCraft.java b/ProjectAirFighter/src/Drawnings/DrawningAirCraft.java index c74ecc2..25af47d 100644 --- a/ProjectAirFighter/src/Drawnings/DrawningAirCraft.java +++ b/ProjectAirFighter/src/Drawnings/DrawningAirCraft.java @@ -79,7 +79,7 @@ public class DrawningAirCraft { _startPosX = x; _startPosY = y; - if (x > _pictureWidth - _drawingAirCraftWidth) { + if (_drawingAirCraftWidth + x > _pictureWidth || x < 0) { _startPosX = 0; } if (_drawingAirCraftHeight + y > _pictureHeight || y < 0) { diff --git a/ProjectAirFighter/src/Drawnings/DrawningAirFighter.java b/ProjectAirFighter/src/Drawnings/DrawningAirFighter.java index 6f6b437..bf173d0 100644 --- a/ProjectAirFighter/src/Drawnings/DrawningAirFighter.java +++ b/ProjectAirFighter/src/Drawnings/DrawningAirFighter.java @@ -1,12 +1,12 @@ package Drawnings; -import Entities.*; +import Entities.EntityAirFighter; import java.awt.*; public class DrawningAirFighter extends DrawningAirCraft { public DrawningAirFighter(int speed, float weight, Color bodyColor, int engineType, Color additionalColor, boolean pgo, boolean rockets) { - super(speed, weight, bodyColor, engineType, 66, 74); + super(speed, weight, bodyColor, engineType, 76, 80); entityAirCraft = new EntityAirFighter(speed, weight, bodyColor, additionalColor, pgo, rockets); } diff --git a/ProjectAirFighter/src/Drawnings/DrawningConstructor.java b/ProjectAirFighter/src/Drawnings/DrawningConstructor.java index c7ab6f5..9b04594 100644 --- a/ProjectAirFighter/src/Drawnings/DrawningConstructor.java +++ b/ProjectAirFighter/src/Drawnings/DrawningConstructor.java @@ -35,9 +35,9 @@ public class DrawningConstructor extends JComponent { int engineCount = countengine[rnd.nextInt(countengine.length)]; _drawEngine.setNumber(engineCount); - int typeBoat = rnd.nextInt(0,2); + int typeAir = rnd.nextInt(0,2); - switch (typeBoat) { + switch (typeAir) { case 0: _entityAirCraft = new EntityAirCraft(rnd.nextInt(70 - 30) + 30, rnd.nextInt(500 - 100) + 100, new Color(rnd.nextInt(0, 256), rnd.nextInt(0, 256), rnd.nextInt(0, 256)));