Compare commits
3 Commits
87be0f7fb2
...
3f2e056315
Author | SHA1 | Date | |
---|---|---|---|
3f2e056315 | |||
3c3737fc84 | |||
b8df03df51 |
@ -21,7 +21,7 @@ namespace AirBomber
|
||||
|
||||
private int _PlaneWidth = 160;
|
||||
|
||||
private int _PlaneHeight = 210;
|
||||
private int _PlaneHeight = 185;
|
||||
|
||||
public bool Init(int speed, int weight, Color bodycolor, Color dopcolor, bool bodykit, bool toplivo, bool rocket, int width, int height)
|
||||
{
|
||||
@ -41,13 +41,11 @@ namespace AirBomber
|
||||
{
|
||||
|
||||
//TODO: Изменения x, y
|
||||
if (x <= _pictureWeigth - _PlaneWidth && y <= _pictureHeight - _PlaneHeight)
|
||||
if (x <= _pictureWeigth - _PlaneWidth && x >= 0 && y <= _pictureHeight - _PlaneHeight && y >= 0)
|
||||
{
|
||||
_startPosX = x;
|
||||
_startPosY = y;
|
||||
}
|
||||
/*_startPosX = x;
|
||||
_startPosY = y;*/
|
||||
}
|
||||
|
||||
public void MoveTransport(Diraction diraction)
|
||||
@ -57,75 +55,54 @@ namespace AirBomber
|
||||
return;
|
||||
}
|
||||
|
||||
int step = (int)EntityAirBomber.Step;
|
||||
|
||||
switch (diraction)
|
||||
{
|
||||
case Diraction.Left:
|
||||
if (EntityAirBomber.BodyKit)
|
||||
if (_startPosX - step >= 0)
|
||||
{
|
||||
if (_startPosX - EntityAirBomber.Step > 0)
|
||||
{
|
||||
_startPosX -= (int)EntityAirBomber.Step;
|
||||
}
|
||||
_startPosX -= step;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_startPosX - EntityAirBomber.Step > 0)
|
||||
{
|
||||
_startPosX -= (int)EntityAirBomber.Step_No_Obves;
|
||||
}
|
||||
_startPosX = 0;
|
||||
}
|
||||
break;
|
||||
case Diraction.Right:
|
||||
if (EntityAirBomber.BodyKit)
|
||||
if (_startPosX + step + _PlaneWidth <= _pictureWeigth)
|
||||
{
|
||||
if (_startPosX + EntityAirBomber.Step + _PlaneWidth < _pictureWeigth)
|
||||
{
|
||||
_startPosX += (int)EntityAirBomber.Step;
|
||||
}
|
||||
_startPosX += step;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_startPosX + EntityAirBomber.Step + _PlaneWidth < _pictureWeigth)
|
||||
{
|
||||
_startPosX += (int)EntityAirBomber.Step_No_Obves;
|
||||
}
|
||||
_startPosX = _pictureWeigth - _PlaneWidth;
|
||||
}
|
||||
break;
|
||||
case Diraction.Up:
|
||||
if (EntityAirBomber.BodyKit)
|
||||
if (_startPosY - step >= 0)
|
||||
{
|
||||
if (_startPosY - EntityAirBomber.Step > 0)
|
||||
{
|
||||
_startPosY -= (int)EntityAirBomber.Step;
|
||||
}
|
||||
_startPosY -= step;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_startPosY - EntityAirBomber.Step > 0)
|
||||
{
|
||||
_startPosY -= (int)EntityAirBomber.Step_No_Obves;
|
||||
}
|
||||
_startPosY = 0;
|
||||
}
|
||||
break;
|
||||
case Diraction.Down:
|
||||
if (EntityAirBomber.BodyKit)
|
||||
if (_startPosY + step + _PlaneHeight <= _pictureHeight)
|
||||
{
|
||||
if (_startPosY + EntityAirBomber.Step + _PlaneHeight < _pictureHeight)
|
||||
{
|
||||
_startPosY += (int)EntityAirBomber.Step;
|
||||
}
|
||||
_startPosY += step;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_startPosY + EntityAirBomber.Step + _PlaneHeight < _pictureHeight)
|
||||
{
|
||||
_startPosY += (int)EntityAirBomber.Step_No_Obves;
|
||||
}
|
||||
_startPosY = _pictureHeight - _PlaneHeight;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void DrawCar(Graphics g)
|
||||
{
|
||||
if (EntityAirBomber == null)
|
||||
|
@ -23,7 +23,6 @@ namespace AirBomber
|
||||
public bool Rocket { get; private set; } //ракеты
|
||||
|
||||
public double Step => (double)Speed * 100 / Weight;
|
||||
public double Step_No_Obves => (double)Speed * 200 / Weight;
|
||||
|
||||
public void Init(int speed, int weight, Color bodycolor, Color dopcolor, bool bodykit, bool toplivo, bool ropcket)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user