Mochalov D.V. Hard LabWork1 #1
@ -80,8 +80,32 @@ class DrawningLocomotive {
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawTransport() {
|
||||
//TODO: do!
|
||||
public void DrawTransport(Graphics g) {
|
||||
if (_startPosX < 0 || _startPosY < 0
|
||||
|| _pictureHeight == null || _pictureWidth == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//тело
|
||||
g.setColor(Color.BLACK);
|
||||
g.drawRect((int)_startPosX , (int)_startPosY, _locomotiveWidth - 10, _locomotiveHeight - 10);
|
||||
//окна
|
||||
g.setColor(Locomotive.getBodyColor());
|
||||
g.fillRect((int)_startPosX + 10, (int)_startPosY + 10, 10, 10);
|
||||
g.fillRect((int)_startPosX + 30, (int)_startPosY + 10, 10, 10);
|
||||
g.fillRect((int)_startPosX + 80, (int)_startPosY + 10, 10, 10);
|
||||
//дверь
|
||||
g.setColor(Color.BLACK);
|
||||
g.drawRect( (int)_startPosX + 50, (int)_startPosY + 10, 10, 20);
|
||||
//колеса
|
||||
g.drawOval((int) _startPosX, (int)_startPosY + 40, 10, 10);
|
||||
g.drawOval((int) _startPosX + 20, (int)_startPosY + 40, 10, 10);
|
||||
g.drawOval((int) _startPosX + 70, (int)_startPosY + 40, 10, 10);
|
||||
g.drawOval((int) _startPosX + 90, (int)_startPosY + 40, 10, 10);
|
||||
//движок
|
||||
g.setColor(Locomotive.getBodyColor());
|
||||
g.fillRect((int)_startPosX + 100, (int)_startPosY + 10, 10, 30);
|
||||
|
||||
}
|
||||
|
||||
public void ChangeBorders(int width, int height)
|
||||
|
@ -37,10 +37,4 @@ public class EntityLocomotive {
|
||||
}
|
||||
BodyColor = bodyColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user