lab1
This commit is contained in:
parent
b9edd805a8
commit
4a1039d391
@ -9,7 +9,6 @@ namespace Cruiser
|
||||
{
|
||||
internal class DrawningCruiser
|
||||
{
|
||||
|
||||
public EntityCruiser? EntityCruiser { get; private set; }
|
||||
|
||||
private int _pictureWidth;
|
||||
@ -56,7 +55,6 @@ additionalColor, bool vert, bool rocket, int width, int height)
|
||||
}
|
||||
switch (direction)
|
||||
{
|
||||
|
||||
case DirectionType.Left:
|
||||
if (_startPosX - EntityCruiser.Step > 0)
|
||||
{
|
||||
@ -88,7 +86,6 @@ additionalColor, bool vert, bool rocket, int width, int height)
|
||||
{
|
||||
_startPosX += _pictureWidth - _startPosX - _cruiserWidth;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case DirectionType.Down:
|
||||
@ -114,10 +111,6 @@ additionalColor, bool vert, bool rocket, int width, int height)
|
||||
Brush additionalBrush = new SolidBrush(EntityCruiser.AdditionalColor);
|
||||
Brush BodyColor = new SolidBrush(EntityCruiser.BodyColor);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GraphicsPath path1 = new GraphicsPath();
|
||||
path1.AddLine(_startPosX + 100, _startPosY + 0, _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.DrawPath(pen, path1);
|
||||
|
||||
|
||||
Brush brBlack = new SolidBrush(Color.Black);
|
||||
|
||||
g.DrawRectangle(pen, _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.FillRectangle(brBlack, _startPosX - 3, _startPosY + 25, 3, 15);
|
||||
|
||||
|
||||
g.DrawRectangle(pen, _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.FillRectangle(brBlack, _startPosX + 30, _startPosY + 19, 30, 13);
|
||||
|
||||
|
||||
if (EntityCruiser.Vert)
|
||||
{
|
||||
|
||||
Brush brRed = new SolidBrush(Color.Red);
|
||||
g.FillEllipse(brRed, _startPosX + 95, _startPosY + 15, 20, 20);
|
||||
g.DrawEllipse(pen, _startPosX + 95, _startPosY + 15, 20, 20);
|
||||
}
|
||||
|
||||
if (EntityCruiser.Rocket)
|
||||
{
|
||||
|
||||
|
||||
g.DrawEllipse(pen, _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.FillEllipse(brBlack, _startPosX + 8, _startPosY + 33, 15, 12);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@ namespace Cruiser
|
||||
{
|
||||
internal class EntityCruiser
|
||||
{
|
||||
|
||||
public int Speed { get; private set; }
|
||||
|
||||
public double Weight { get; private set; }
|
||||
@ -17,7 +16,6 @@ namespace Cruiser
|
||||
|
||||
public Color AdditionalColor { get; private set; }
|
||||
|
||||
|
||||
public bool Vert { get; private set; }
|
||||
|
||||
public bool Rocket { get; private set; }
|
||||
|
@ -4,14 +4,13 @@ namespace Cruiser
|
||||
{
|
||||
public partial class FormCruiser : Form
|
||||
{
|
||||
|
||||
private DrawningCruiser? _drawningCruiser;
|
||||
|
||||
public FormCruiser()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
private void Draw()
|
||||
{
|
||||
if (_drawningCruiser == null)
|
||||
|
Loading…
Reference in New Issue
Block a user