Exemplo n.º 1
0
 def test_returns_incremented_angle_when_given_non_normalised_angles(self):
     self.assertEquals(50, Game.near_angle(-320, 420, 10))
Exemplo n.º 2
0
 def test_returns_target_angle_when_segment_closer_than_increment_in_neg_direction(self):
     self.assertEquals(30, Game.near_angle(45, 30, 20, 5))
Exemplo n.º 3
0
 def test_returns_same_angle_when_within_target_segment(self):
     self.assertEquals(45, Game.near_angle(45, 30, 10, 20))
Exemplo n.º 4
0
 def test_returns_incremented_angle_when_segment_further_away_than_increment_in_neg_direction(self):
     self.assertEquals(110, Game.near_angle(120, 15, 10, 20))
Exemplo n.º 5
0
 def test_returns_incremented_angle_when_segment_further_away_than_increment_in_pos_direction(self):
     self.assertEquals(55, Game.near_angle(45, 135, 10, 20))
Exemplo n.º 6
0
 def test_returns_target_angle_when_at_target_angle(self):
     self.assertEquals(135, Game.near_angle(135, 135, 10))
Exemplo n.º 7
0
 def test_returns_target_angle_when_closer_than_increment_in_negative_direction(self):
     self.assertEquals(135, Game.near_angle(140, 135, 10))
Exemplo n.º 8
0
 def test_returns_incremented_angle_when_further_away_than_increment_in_negative_direction(self):
     self.assertEquals(35, Game.near_angle(45, 15, 10))