def test_update_key_event_top_left(self): game_state = GameState() game_state.key_presses.up = True game_state.key_presses.left = True game_state.window_size = Vector(1280, 720) game_state.update() actual = game_state.world_offset self.assertEqual(Vector(105, 95), actual)
def test_update_key_event_bottom_right(self): game_state = GameState() game_state.key_presses.down = True game_state.key_presses.right = True game_state.window_size = Vector(1280, 720) game_state.update() actual = game_state.world_offset self.assertEqual(Vector(95, 105), actual)
def test_update_no_key_event(self): game_state = GameState() world_offset_before = game_state.world_offset game_state.window_size = Vector(1280, 720) game_state.update() self.assertEqual(world_offset_before, game_state.world_offset)