From ccfa42bf48a3a6286b647d1b3a314fcac82c517c Mon Sep 17 00:00:00 2001 From: goblinrf Date: Sat, 14 Oct 2023 20:06:08 +0300 Subject: [PATCH] Done --- .idea/.gitignore | 3 +++ src/AirFighterHard/DrawningAirFighter.java | 2 +- src/AirFighterHard/DrawningEngines.java | 10 ++++------ 3 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/src/AirFighterHard/DrawningAirFighter.java b/src/AirFighterHard/DrawningAirFighter.java index 5ff77ac..a5267de 100644 --- a/src/AirFighterHard/DrawningAirFighter.java +++ b/src/AirFighterHard/DrawningAirFighter.java @@ -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; diff --git a/src/AirFighterHard/DrawningEngines.java b/src/AirFighterHard/DrawningEngines.java index d78208b..e077857 100644 --- a/src/AirFighterHard/DrawningEngines.java +++ b/src/AirFighterHard/DrawningEngines.java @@ -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; }