Example #1
0
 def test_get_clicked_algorithmspkg(self):
     algrid_config = GameConfig(window_size=(600, 600), debug_mode=True)
     algrid_screen = GameScreen(algrid_config, GameModel())
     algrid_qg = QuadraticGrid(
         10, 10, diag_neighbors=False, border_properties=BorderProperties()
     )
     self.assertEqual((4, 7), algrid_qg.get_clicked_cell(algrid_screen, (424, 294)))
Example #2
0
 def test_get_clicked(self):
     grid_config = GameConfig(window_size=(600, 400))
     screen = GameScreen(grid_config, GameModel())
     qg = QuadraticGrid(10, 10, 400, 400)
     self.assertIsNone(qg.get_clicked_cell(screen, (404, 404)))
Example #3
0
 def test_get_clicked_width_limited(self):
     grid_config = GameConfig(window_size=(600, 400))
     screen = GameScreen(grid_config, GameModel())
     qg = QuadraticGrid(10, 10, 400, 400)
     self.assertEqual((8, 3), qg.get_clicked_cell(screen, (121, 323)))
Example #4
0
 def test_get_clicked_cell_squarefull(self):
     square_config = GameConfig(window_size=(80, 80))
     square_screen = GameScreen(square_config, GameModel())
     square_grid = QuadraticGrid(8, 8)
     self.assertEqual((7, 3), square_grid.get_clicked_cell(square_screen, (36, 74)))