This commit is contained in:
Александр Чегодаев 2023-12-13 23:10:44 +04:00
parent b9edd805a8
commit 4a1039d391
3 changed files with 2 additions and 20 deletions

View File

@ -9,7 +9,6 @@ namespace Cruiser
{ {
internal class DrawningCruiser internal class DrawningCruiser
{ {
public EntityCruiser? EntityCruiser { get; private set; } public EntityCruiser? EntityCruiser { get; private set; }
private int _pictureWidth; private int _pictureWidth;
@ -56,7 +55,6 @@ additionalColor, bool vert, bool rocket, int width, int height)
} }
switch (direction) switch (direction)
{ {
case DirectionType.Left: case DirectionType.Left:
if (_startPosX - EntityCruiser.Step > 0) if (_startPosX - EntityCruiser.Step > 0)
{ {
@ -88,7 +86,6 @@ additionalColor, bool vert, bool rocket, int width, int height)
{ {
_startPosX += _pictureWidth - _startPosX - _cruiserWidth; _startPosX += _pictureWidth - _startPosX - _cruiserWidth;
} }
break; break;
case DirectionType.Down: case DirectionType.Down:
@ -114,10 +111,6 @@ additionalColor, bool vert, bool rocket, int width, int height)
Brush additionalBrush = new SolidBrush(EntityCruiser.AdditionalColor); Brush additionalBrush = new SolidBrush(EntityCruiser.AdditionalColor);
Brush BodyColor = new SolidBrush(EntityCruiser.BodyColor); Brush BodyColor = new SolidBrush(EntityCruiser.BodyColor);
GraphicsPath path1 = new GraphicsPath(); GraphicsPath path1 = new GraphicsPath();
path1.AddLine(_startPosX + 100, _startPosY + 0, _startPosX + 0, _startPosY + 0); path1.AddLine(_startPosX + 100, _startPosY + 0, _startPosX + 0, _startPosY + 0);
path1.AddLine(_startPosX + 0, _startPosY + 50, _startPosX + 0, _startPosY + 0); path1.AddLine(_startPosX + 0, _startPosY + 50, _startPosX + 0, _startPosY + 0);
@ -128,32 +121,27 @@ additionalColor, bool vert, bool rocket, int width, int height)
g.FillPath(additionalBrush, path1); g.FillPath(additionalBrush, path1);
g.DrawPath(pen, path1); g.DrawPath(pen, path1);
Brush brBlack = new SolidBrush(Color.Black); Brush brBlack = new SolidBrush(Color.Black);
g.DrawRectangle(pen, _startPosX - 3, _startPosY + 7, 3, 15); g.DrawRectangle(pen, _startPosX - 3, _startPosY + 7, 3, 15);
g.FillRectangle(brBlack, _startPosX - 3, _startPosY + 7, 3, 15); g.FillRectangle(brBlack, _startPosX - 3, _startPosY + 7, 3, 15);
g.DrawRectangle(pen, _startPosX - 3, _startPosY + 25, 3, 15); g.DrawRectangle(pen, _startPosX - 3, _startPosY + 25, 3, 15);
g.FillRectangle(brBlack, _startPosX - 3, _startPosY + 25, 3, 15); g.FillRectangle(brBlack, _startPosX - 3, _startPosY + 25, 3, 15);
g.DrawRectangle(pen, _startPosX + 60, _startPosY + 12, 20, 25); g.DrawRectangle(pen, _startPosX + 60, _startPosY + 12, 20, 25);
g.FillRectangle(brBlack, _startPosX + 60, _startPosY + 12, 20, 25); g.FillRectangle(brBlack, _startPosX + 60, _startPosY + 12, 20, 25);
g.DrawRectangle(pen, _startPosX + 30, _startPosY + 19, 30, 13); g.DrawRectangle(pen, _startPosX + 30, _startPosY + 19, 30, 13);
g.FillRectangle(brBlack, _startPosX + 30, _startPosY + 19, 30, 13); g.FillRectangle(brBlack, _startPosX + 30, _startPosY + 19, 30, 13);
if (EntityCruiser.Vert) if (EntityCruiser.Vert)
{ {
Brush brRed = new SolidBrush(Color.Red); Brush brRed = new SolidBrush(Color.Red);
g.FillEllipse(brRed, _startPosX + 95, _startPosY + 15, 20, 20); g.FillEllipse(brRed, _startPosX + 95, _startPosY + 15, 20, 20);
g.DrawEllipse(pen, _startPosX + 95, _startPosY + 15, 20, 20); g.DrawEllipse(pen, _startPosX + 95, _startPosY + 15, 20, 20);
} }
if (EntityCruiser.Rocket) if (EntityCruiser.Rocket)
{ {
g.DrawEllipse(pen, _startPosX + 8, _startPosY + 3, 15, 12); g.DrawEllipse(pen, _startPosX + 8, _startPosY + 3, 15, 12);
g.FillEllipse(brBlack, _startPosX + 8, _startPosY + 3, 15, 12); g.FillEllipse(brBlack, _startPosX + 8, _startPosY + 3, 15, 12);
@ -162,11 +150,8 @@ additionalColor, bool vert, bool rocket, int width, int height)
g.DrawEllipse(pen, _startPosX + 8, _startPosY + 33, 15, 12); g.DrawEllipse(pen, _startPosX + 8, _startPosY + 33, 15, 12);
g.FillEllipse(brBlack, _startPosX + 8, _startPosY + 33, 15, 12); g.FillEllipse(brBlack, _startPosX + 8, _startPosY + 33, 15, 12);
} }
} }
} }
} }

View File

@ -8,7 +8,6 @@ namespace Cruiser
{ {
internal class EntityCruiser internal class EntityCruiser
{ {
public int Speed { get; private set; } public int Speed { get; private set; }
public double Weight { get; private set; } public double Weight { get; private set; }
@ -17,7 +16,6 @@ namespace Cruiser
public Color AdditionalColor { get; private set; } public Color AdditionalColor { get; private set; }
public bool Vert { get; private set; } public bool Vert { get; private set; }
public bool Rocket { get; private set; } public bool Rocket { get; private set; }

View File

@ -4,14 +4,13 @@ namespace Cruiser
{ {
public partial class FormCruiser : Form public partial class FormCruiser : Form
{ {
private DrawningCruiser? _drawningCruiser; private DrawningCruiser? _drawningCruiser;
public FormCruiser() public FormCruiser()
{ {
InitializeComponent(); InitializeComponent();
} }
private void Draw() private void Draw()
{ {
if (_drawningCruiser == null) if (_drawningCruiser == null)