예제 #1
0
 def test_tank_player_shoot(self):
     player = tank.Player(50, 50, 50, 'regular', 100, 'dire')
     camera = g.Camera(100, 100)
     player.missiles.append(g.Missile(10, 10, 10, 10, 10))
     player.missiles.append(g.Missile(-10, -10, 10, 10, 10))
     player.bullet_check()
     self.assertTrue(True)
 def test_castle_draw(self):
     game_display = s.GAME_DISPLAY
     camera = go.Camera(500, 500)
     castle = go.Castle(0, 0, 16, "alive", "dire")
     castle.draw(game_display, camera)
     castle.state = "destroyed"
     castle.draw(game_display, camera)
     self.assertTrue(True)
 def test_terrain_draw(self):
     game_display = s.GAME_DISPLAY
     camera = go.Camera(500, 500)
     water = go.Terrain(0, 0, 25, 'WATER')
     iron = go.Terrain(0, 0, 25, 'iron')
     bush = go.Terrain(0, 0, 25, 'BUSH')
     brick = go.Terrain(0, 0, 25, 'BRICK')
     iron_floor = go.Terrain(0, 0, 25, "IRON_FLOOR")
     water.draw(game_display, camera)
     iron.draw(game_display, camera)
     bush.draw(game_display, camera)
     brick.draw(game_display, camera)
     iron_floor.draw(game_display, camera)
     self.assertTrue(True)
 def test_move_bullets_cl(self):
     game_map = cliient.game_map
     player = tank.Player(0, 0, 0, 20, 100, "radiant")
     missile = go.Missile(1, 1, 16, 2, 2)
     missile2 = go.Missile(20, 20, 16, 2, 2)
     missile3 = go.Missile(0, 0, 2500, 2, 2)
     player.missiles.append(missile2)
     game_display = s.GAME_DISPLAY
     camera = go.Camera(500, 500)
     castle = go.Castle(20, 20, 16, "alive", "dire")
     cl.move_bullets(player, castle, game_display, camera, game_map)
     player.missiles.append(missile)
     cl.move_bullets(player, castle, game_display, camera, game_map)
     player.missiles.append(missile3)
     cl.move_bullets(player, castle, game_display, camera, game_map)
     self.assertTrue(True)
 def test_bullets_movement(self):
     player = tank.Player(0, 0, 0, 20, 100, "radiant")
     enemy = tank.Enemy(30, 30, 0, "regular")
     missile = go.Missile(0, 0, 16, 2, 2)
     player.missiles.append(missile)
     game_display = s.GAME_DISPLAY
     camera = go.Camera(500, 500)
     castle = go.Castle(20, 20, 16, "alive", "dire")
     cliient.move_bullets(player, enemy, castle, game_display, camera)
     missile1 = go.Missile(30, 30, 16, 2, 2)
     player.missiles.append(missile1)
     cliient.move_bullets(player, enemy, castle, game_display, camera)
     missile2 = go.Missile(20, 20, 16, 2, 2)
     player.missiles.append(missile2)
     cliient.move_bullets(player, enemy, castle, game_display, camera)
     self.assertTrue(True)
 def test_camera_update(self):
     camera = go.Camera(500, 500)
     game_object_1 = go.GameObject(50, 50, 50)
     camera.update(game_object_1)
     self.assertTrue(True)
 def test_gameobject_explosion(self):
     camera = go.Camera(500, 500)
     game_object_1 = go.GameObject(50, 50, 50)
     game_display = s.GAME_DISPLAY
     game_object_1.draw_explosion(game_display, camera)
     self.assertTrue(True)
 def test_camera_init(self):
     camera = go.Camera(500, 500)
     self.assertTrue(isinstance(camera, go.Camera))
 def test_map_collision(self):
     player = tank.Player(0, 0, 0, 20, 100, "radiant")
     camera = go.Camera(500, 500)
     game_map = cliient.game_map
     res = cl.check_map_collision(game_map, player, camera)
     self.assertTrue(res)
예제 #10
0
 def test_castle_check(self):
     camera = go.Camera(500, 500)
     castle = go.Castle(20, 20, 16, "alive", "dire")
     castle.hp = 0
     result = cliient.check_castle(castle, camera)
     self.assertTrue(True)
예제 #11
0
 def test_random_explosion(self):
     game_display = s.GAME_DISPLAY
     camera = go.Camera(500, 500)
     cliient.draw_explosion(game_display, 0, 0, camera)
     self.assertTrue(True)
예제 #12
0
 def test_tank_player(self):
     player = tank.Player(50, 50, 50, 'regular', 100, 'dire')
     camera = g.Camera(100, 100)
     player.modify(s.GAME_DISPLAY, camera, s.PLAYER_SPRITE, True)
     self.assertTrue(True)
예제 #13
0
 def test_tank_explodes(self):
     enemy = tank.Enemy(50, 50, 50, 'regular')
     camera = g.Camera(100, 100)
     game_display = s.GAME_DISPLAY
     enemy.draw_explosion(game_display, camera)
     self.assertTrue(True)
예제 #14
0
 def test_tank(self):
     enemy = tank.Enemy(50, 50, 50, 'regular')
     camera = g.Camera(100, 100)
     game_display = s.GAME_DISPLAY
     enemy.draw(game_display, s.ENEMY_HEAVY_SPRITE, camera)
     self.assertTrue(True)
예제 #15
0
 def test_check_castle(self):
     client = t.Client(0)
     castle = g.Castle(50, 50, 50, 'alive', 'friendly')
     camera = g.Camera(500, 500)
     self.assertFalse(client.check_castle(castle, camera))