Ejemplo n.º 1
0
    def update(self, dt):
        self.x += self.velocity_x * dt
        self.y += self.velocity_y * dt

        self.rotation += self.rotation_speed * dt
        self.rotation = utils.normalize_degrees(self.rotation)

        self.loop_position()
Ejemplo n.º 2
0
def test_normalize_degrees__negative_overflow():
    rounded = "{:.4f}".format(utils.normalize_degrees(-1785.0))
    assert rounded == '15.0000'
Ejemplo n.º 3
0
def test_normalize_degrees__positive_overflow():
    rounded = "{:.4f}".format(utils.normalize_degrees(465.345))
    assert rounded == '105.3450'
Ejemplo n.º 4
0
def test_normalize_degrees__negative():
    rounded = "{:.4f}".format(utils.normalize_degrees(-134.234))
    assert rounded == '225.7660'
Ejemplo n.º 5
0
def test_normalize_degrees__noop():
    rounded = "{:.4f}".format(utils.normalize_degrees(97.5))
    assert rounded == '97.5000'