Пример #1
0
 def shipPoints(self):
     points: List = [
         getPointFromPolarCoordinate(self.position, self.size, math.radians(self.rotation)),
         getPointFromPolarCoordinate(self.position, self.size, math.radians(225 + self.rotation)),
         getPointFromPolarCoordinate(self.position, self.size // 4, math.radians(180 + self.rotation)),
         getPointFromPolarCoordinate(self.position, self.size, math.radians(135 + self.rotation))
     ]
     return points
Пример #2
0
 def _drawFire(self, surface: Surface) -> None:
     backOfShip = getPointFromPolarCoordinate(self.position, self.size / 4, math.radians(180 + self.rotation))
     points: List = [
         backOfShip,
         getPointFromPolarCoordinate(backOfShip, self.thrustSize * 0.75, math.radians(145 + self.rotation)),
         getPointFromPolarCoordinate(backOfShip, self.thrustSize / 2, math.radians(165 + self.rotation)),
         getPointFromPolarCoordinate(backOfShip, self.thrustSize, math.radians(180 + self.rotation)),
         getPointFromPolarCoordinate(backOfShip, self.thrustSize / 2, math.radians(195 + self.rotation)),
         getPointFromPolarCoordinate(backOfShip, self.thrustSize * 0.75, math.radians(215 + self.rotation)),
     ]
     draw.polygon(surface, self.thrustColor.value, points)
Пример #3
0
 def heading(self):
     return array(getPointFromPolarCoordinate((0, 0), 1, math.radians(self.rotation)))
Пример #4
0
 def test_numbers_0_0_5_0(self):
     point = getPointFromPolarCoordinate((0, 0), 1, math.radians(0))
     print(0, 1, point)
     self.assertEqual(point, (1, 0))
Пример #5
0
 def test_accuracy(self):
     point1 = getPointFromPolarCoordinate((0, 0), 1, math.radians(45))