This commit is contained in:
goblinrf 2023-10-14 20:06:08 +03:00
parent 576f76a841
commit ccfa42bf48
3 changed files with 8 additions and 7 deletions

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