ПИбд-23 Кислица Егор Дмитриевич Лабораторная работа №1 (усложненная) #1

Closed
Egor wants to merge 16 commits from Laba1 into main
3 changed files with 8 additions and 7 deletions
Showing only changes of commit ccfa42bf48 - Show all commits

3
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -37,7 +37,7 @@ public class DrawningAirFighter {
EntityAirFighter.Init(speed, weight, bodyColor, engineNumb, racket, wing);
DrawningEngines = new DrawningEngines();
DrawningEngines.Init(_airfighterWidth, _airfighterHeight,_startPosX,_startPosY,airfighterPanel);
DrawningEngines.Init(_startPosX,_startPosY,airfighterPanel);
Random rand = new Random();
DrawningEngines.ChangeEnginesNumb(rand.nextInt(1, 4));
return true;

View File

@ -8,13 +8,11 @@ public class DrawningEngines {
JPanel AirFighterPanel;
private NumberType EnginesNumb;
private Color EngineColor;
private int Width, Height;
public int CurX, CurY;
boolean Init(int width, int height, int curX, int curY, JPanel airfighterPanel){
Width = width;
Height = height;
boolean Init( int curX, int curY, JPanel airfighterPanel){
CurX = curX;
CurY = curY;
EngineColor = Color.BLACK;
@ -24,11 +22,11 @@ public class DrawningEngines {
}
public void ChangeEnginesNumb(int x){
if(x ==1)
if(x <= 1)
EnginesNumb = NumberType.Two;
if(x == 2)
EnginesNumb = NumberType.Four;
if(x == 3)
if(x >= 3)
EnginesNumb = NumberType.Six;
}