Karamushko M.K lab2_base #4

Closed
maxKarme wants to merge 9 commits from lab2_base into lab1_base
3 changed files with 4 additions and 7 deletions
Showing only changes of commit 496f946e45 - Show all commits

View File

@ -19,10 +19,9 @@ namespace AirFighter
private readonly int _airFighterWidth = 195;
private readonly int _airFighterHeight = 166;
public void Init(int speed, float weight, Color bodyColor)
public DrawingAirFighter(int speed, float weight, Color bodyColor)
{
AirFighter = new EntityAirFighter();
AirFighter.Init(speed, weight, bodyColor);
AirFighter = new EntityAirFighter(speed, weight, bodyColor);
}
public void SetPosition(int x, int y, int width, int height)

View File

@ -14,7 +14,7 @@ namespace AirFighter
public float Step => Speed * 100 / Weight;
public void Init(int speed, float weight, Color bodyColor)
public EntityAirFighter(int speed, float weight, Color bodyColor)
{
Random rnd = new();

View File

@ -13,9 +13,7 @@ namespace AirFighter
{
Random rnd = new();
_airFighter = new DrawingAirFighter();
_airFighter.Init(rnd.Next(100, 300), rnd.Next(1000, 2000),
_airFighter = new DrawingAirFighter(rnd.Next(100, 300), rnd.Next(1000, 2000),
Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
_airFighter.SetPosition(rnd.Next(10, 100), rnd.Next(10, 100), pictureBox.Width, pictureBox.Height);