Конец

This commit is contained in:
artur-kalimullin 2024-06-16 13:43:13 +04:00
parent 23058f6672
commit c432bf98b7
3 changed files with 5 additions and 5 deletions

View File

@ -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) {

View File

@ -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);
}

View File

@ -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)));