代码拉取完成,页面将自动刷新
import pygame
import numpy as np
import enemy
import Buff
import Trap
class Blocks:
def __init__(self):
self.image = pygame.image.load(r"image\temple.png").convert_alpha()
self.rect = self.image.get_rect()
self.size = 24
self.coord_x = self.rect.left + 12
self.coord_y = self.rect.top + 12
class a_star_block:
def __init__(self, x, y):
self.coord_x = x
self.coord_y = y
self.F = 0
self.H = 0
self.G = 0
self.prev = [-1, -1]
class Up_Door:
def __init__(self):
self.image = pygame.image.load(r"image\up_door.png").convert_alpha()
self.rect = self.image.get_rect()
self.size = 24
self.coord_x = self.rect.left + 12
self.coord_y = self.rect.top + 12
class Down_Door:
def __init__(self):
self.image = pygame.image.load(r"image\down_door.png").convert_alpha()
self.rect = self.image.get_rect()
self.size = 24
self.coord_x = self.rect.left + 12
self.coord_y = self.rect.top + 12
class Right_Door:
def __init__(self):
self.image = pygame.image.load(r"image\right_door.png").convert_alpha()
self.rect = self.image.get_rect()
self.size = 24
self.coord_x = self.rect.left + 12
self.coord_y = self.rect.top + 12
class Left_Door:
def __init__(self):
self.image = pygame.image.load(r"image\left_door.png").convert_alpha()
self.rect = self.image.get_rect()
self.size = 24
self.coord_x = self.rect.left + 12
self.coord_y = self.rect.top + 12
class Special_Door:
def __init__(self):
self.image = pygame.image.load(r"image\special_door.png").convert_alpha()
self.rect = self.image.get_rect()
self.size = 24
self.coord_x = self.rect.left + 12
self.coord_y = self.rect.top + 12
class Border:
def __init__(self):
self.image = pygame.image.load(r"image\border.png").convert_alpha()
self.rect = self.image.get_rect()
self.size = 24
self.coord_x = self.rect.left + 12
self.coord_y = self.rect.top + 12
class Little_head:
def __init__(self):
self.image = pygame.image.load(r"image\little_head.png").convert_alpha()
self.rect = self.image.get_rect()
self.size = 16
self.coord_x = self.rect.left + 8
self.coord_y = self.rect.top + 8
class Rock:
def __init__(self):
self.image = pygame.image.load(r"image\rock.png").convert_alpha()
self.rect = self.image.get_rect()
self.coord_x = self.rect.left + 72
self.coord_y = self.rect.top + 50
def SmallMap(self):
self.blockGroup = list()
X1 = [630, 678, 702, 726]
Y1 = [72]
X2 = [630, 654, 678, 726]
Y2 = [96]
X3 = [630, 678, 702, 726]
Y3 = [120]
X4 = [654, 678, 702]
Y4 = [144]
X5 = [630, 678]
Y5 = [168]
X6 = [630, 654, 678, 702, 726]
Y6 = [192]
X7 = [726]
Y7 = [216]
for x in X1:
for y in Y1:
self.block = Border()
self.block.rect.left, self.block.rect.top = x, y
self.blockGroup.append(self.block)
for y in Y2:
for x in X2:
self.block = Border()
self.block.rect.left, self.block.rect.top = x, y
self.blockGroup.append(self.block)
for x in X3:
for y in Y3:
self.block = Border()
self.block.rect.left, self.block.rect.top = x, y
self.blockGroup.append(self.block)
for x in X4:
for y in Y4:
self.block = Border()
self.block.rect.left, self.block.rect.top = x, y
self.blockGroup.append(self.block)
for x in X5:
for y in Y5:
self.block = Border()
self.block.rect.left, self.block.rect.top = x, y
self.blockGroup.append(self.block)
for y in Y6:
for x in X6:
self.block = Border()
self.block.rect.left, self.block.rect.top = x, y
self.blockGroup.append(self.block)
for y in Y7:
for x in X7:
self.block = Border()
self.block.rect.left, self.block.rect.top = x, y
self.blockGroup.append(self.block)
# initialize parameters
def init_para(self):
self.enemy_number = 4
self.over = False
self.doorGroup = list()
self.traps = list()
self.enemies = list()
self.steady_buff = list()
self.blockGroup = list()
self.size = 24
self.maze = np.zeros(shape=(630, 630))
self.block_maze = np.zeros(shape=(26, 26)) # narrowed maze, "1" marks the wall block
self.sound = pygame.mixer.Sound("sound/soundtrack/Eclipse.mp3")
self.sound.set_volume(0.4)
# assign map1 value
def map1_para(self):
self.traps.append(Trap.Traps(147, 435, 0, True))
self.enemies.append(enemy.Enemy(1, 27, 315))
self.enemies.append(enemy.Enemy(1, 531, 123))
self.enemies.append(enemy.Enemy(2, 219, 147))
self.enemies.append(enemy.Enemy(2, 531, 504))
self.steady_buff.append(Buff.BuffStuff(50, 300, 3))
self.steady_buff.append(Buff.BuffStuff(420, 200, 1))
# assign map2 value
def map2_para(self):
self.traps.append(Trap.Traps(243, 339, 0, False))
self.enemies.append(enemy.Enemy(1, 27, 27))
self.enemies.append(enemy.Enemy(1, 363, 363))
self.enemies.append(enemy.Enemy(2, 483, 51))
self.enemies.append(enemy.Enemy(2, 51, 315))
self.steady_buff.append(Buff.BuffStuff(291, 195, 3))
self.steady_buff.append(Buff.BuffStuff(171, 411, 0))
# assign map3 value
def map3_para(self):
self.traps.append(Trap.Traps(363, 267, 1, True))
self.enemies.append(enemy.Enemy(1, 27, 243))
self.enemies.append(enemy.Enemy(1, 267, 459))
self.enemies.append(enemy.Enemy(2, 243, 171))
self.enemies.append(enemy.Enemy(2, 531, 143))
self.steady_buff.append(Buff.BuffStuff(51, 51, 2))
self.steady_buff.append(Buff.BuffStuff(387, 171, 0))
# assign map4 value
def map4_para(self):
self.traps.append(Trap.Traps(339, 147, 1, False))
self.enemies.append(enemy.Enemy(1, 51, 75))
self.enemies.append(enemy.Enemy(1, 411, 435))
self.enemies.append(enemy.Enemy(2, 483, 99))
self.enemies.append(enemy.Enemy(2, 171, 291))
self.steady_buff.append(Buff.BuffStuff(315, 267, 2))
self.steady_buff.append(Buff.BuffStuff(123, 435, 1))
# assign boss room value
def map5_para(self):
self.traps.append(Trap.Traps(483, 195, 1, True))
self.steady_buff.append(Buff.BuffStuff(51, 219, 3))
self.steady_buff.append(Buff.BuffStuff(507, 339, 2))
self.enemies.append(enemy.Enemy(1, 483, 483))
self.enemies.append(enemy.Enemy(2, 51, 483))
self.enemies.append(enemy.Enemy(2, 483, 75))
self.enemies.append(enemy.Enemy(3, 267, 267))
# assign special room value
def map6_para(self):
self.traps.append(Trap.Traps(411, 291, 1, True))
self.steady_buff.append(Buff.BuffStuff(339, 75, 3))
self.steady_buff.append(Buff.BuffStuff(339, 171, 1))
self.steady_buff.append(Buff.BuffStuff(531, 435, 0))
self.enemies.append(enemy.Enemy(2, 267, 75))
self.enemies.append(enemy.Enemy(2, 51, 99))
self.enemies.append(enemy.Enemy(2, 195, 315))
self.enemies.append(enemy.Enemy(2, 75, 411))
# wall generation
def make_wall1(self):
X1 = [4, 5]
Y1 = [5, 6, 7, 8, 9, 10, 19, 20, 21, 22, 23, 24]
X21 = [8]
Y21 = [6, 7, 8, 9, 10, 11, 12, 13]
X22 = [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
Y22 = [5]
X3 = [18, 19]
Y3 = [1, 2, 3, 4]
X4 = [13, 14]
Y4 = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
X5 = [9, 10, 11, 12]
Y5 = [20]
X6 = [19, 20, 21, 22, 23, 24]
Y6 = [12]
X7 = [19]
Y7 = [13, 14, 15, 16, 17, 18, 19, 20]
for x in X1:
for y in Y1:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y21:
for x in X21:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y22:
for x in X22:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X3:
for y in Y3:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X4:
for y in Y4:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X5:
for y in Y5:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y6:
for x in X6:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X7:
for y in Y7:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
def make_wall2(self):
X21 = [5]
Y21 = [5, 6, 7, 8, 9, 10, 11, 12]
X22 = [4, 5]
Y22 = [18, 19, 20, 21, 22, 23, 24]
X3 = [9, 16]
Y3 = [5, 6, 7, 8, 9, 10, 11]
X4 = [10, 11, 12, 13, 14, 15]
Y4 = [5]
X5 = [17, 18, 19, 20, 21]
Y5 = [7, 8]
X6 = [20, 21]
Y6 = [13, 14, 15]
X7 = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
Y7 = [20, 21]
for y in Y21:
for x in X21:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.block_maze[y, x] = 1
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y22:
for x in X22:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.block_maze[y, x] = 1
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X3:
for y in Y3:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.block_maze[y, x] = 1
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X4:
for y in Y4:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.block_maze[y, x] = 1
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X5:
for y in Y5:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.block_maze[y, x] = 1
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y6:
for x in X6:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.block_maze[y, x] = 1
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X7:
for y in Y7:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.block_maze[y, x] = 1
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
def make_wall3(self):
X1 = [4, 5, 20, 21]
Y1 = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
X21 = [10]
Y21 = [5, 6, 7, 8, 9, 10]
X22 = [11, 12, 13, 14]
Y22 = [5]
X3 = [15]
Y3 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
X4 = [19, 20, 21, 22, 23, 24]
Y4 = [4]
X5 = [10]
Y5 = [17, 18, 19, 20, 21, 22, 23, 24]
X6 = [10, 11, 12, 13, 14, 15, 16]
Y6 = [17, 18]
for x in X1:
for y in Y1:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y21:
for x in X21:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y22:
for x in X22:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X3:
for y in Y3:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X4:
for y in Y4:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X5:
for y in Y5:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y6:
for x in X6:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
def make_wall4(self):
X1 = [5, 6]
Y1 = [5, 6, 7, 8, 9]
Y21 = [5, 6, 7, 8]
X21 = [10]
X22 = [11]
Y22 = [8]
X3 = [12]
Y3 = [8, 9, 10, 11, 12, 13, 14, 15, 16]
X4 = [8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
Y4 = [17]
X5 = [1, 2, 3, 4]
Y5 = [14]
X6 = [4]
Y6 = [15, 16, 17, 18, 19, 20, 21]
X7 = [8, 9, 16, 17]
Y7 = [23, 24]
X8 = [17]
Y8 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
X9 = [21]
Y9 = [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
for x in X1:
for y in Y1:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y21:
for x in X21:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y22:
for x in X22:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X3:
for y in Y3:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X4:
for y in Y4:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X5:
for y in Y5:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y6:
for x in X6:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y7:
for x in X7:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y8:
for x in X8:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y9:
for x in X9:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
def make_wall5(self):
X1 = [8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
Y1 = [6, 19]
X2 = [7, 18]
Y2 = [6, 7, 8, 9, 10, 15, 16, 17, 18, 19]
for x in X1:
for y in Y1:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X2:
for y in Y2:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
def make_wall6(self):
X1 = [4, 5, 6, 7, 18, 19, 20, 21]
Y1 = [4, 5, 6, 7]
X2 = [7, 8, 12, 13, 17, 18]
Y2 = [18, 19, 20, 21]
X3 = [9, 10, 11, 14, 15, 16]
Y3 = [20, 21]
for x in X1:
for y in Y1:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for y in Y2:
for x in X2:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X3:
for y in Y3:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
# corridor
def make_wall8(self):
X1 = [1, 7, 13, 19]
Y1 = [4]
X2 = [1, 7, 13, 19]
Y2 = [17]
for x in X1:
for y in Y1:
self.block = Rock()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 147 + x * 24):
for yi in range(3 + y * 24, 102 + y * 24):
self.maze[xi, yi] = 1
for y in Y2:
for x in X2:
self.block = Rock()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 147 + x * 24):
for yi in range(3 + y * 24, 102 + y * 24):
self.maze[xi, yi] = 1
def make_wall9(self):
X1 = [1, 2, 3, 5, 7, 10, 13, 17, 21, 22, 23]
Y1 = [3]
X2 = [2, 5, 7, 9, 11, 13, 14, 15, 17, 21]
Y2 = [4]
X3 = [2, 5, 7, 9, 11, 13, 15, 17, 18, 19, 21]
Y3 = [5]
X4 = [2, 5, 6, 7, 9, 10, 11, 13, 15, 17, 19, 21, 22, 23]
Y4 = [6]
X5 = [2, 5, 7, 9, 11, 13, 15, 17, 18, 19, 23]
Y5 = [7]
X6 = [2, 5, 7, 9, 11, 13, 15, 17, 18, 23]
Y6 = [8]
X7 = [2, 5, 7, 9, 11, 13, 15, 17, 19, 21, 22, 23]
Y7 = [9]
X11 = [1, 2, 3, 5, 7, 10, 13, 17, 21, 22, 23]
Y11 = [15]
X21 = [2, 5, 7, 9, 11, 13, 14, 15, 17, 21]
Y21 = [16]
X31 = [2, 5, 7, 9, 11, 13, 15, 17, 18, 19, 21]
Y31 = [17]
X41 = [2, 5, 6, 7, 9, 10, 11, 13, 15, 17, 19, 21, 22, 23]
Y41 = [18]
X51 = [2, 5, 7, 9, 11, 13, 15, 17, 18, 19, 23]
Y51 = [19]
X61 = [2, 5, 7, 9, 11, 13, 15, 17, 18, 23]
Y61 = [20]
X71 = [2, 5, 7, 9, 11, 13, 15, 17, 19, 21, 22, 23]
Y71 = [21]
for x in X1:
for y in Y1:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X2:
for y in Y2:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X3:
for y in Y3:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X4:
for y in Y4:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X5:
for y in Y5:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X6:
for y in Y6:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X7:
for y in Y7:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X11:
for y in Y11:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X21:
for y in Y21:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X31:
for y in Y31:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X41:
for y in Y41:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X51:
for y in Y51:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X61:
for y in Y61:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in X71:
for y in Y71:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
# Up wall no door
def up_no_door(self):
Xup = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
Yup = [0]
for y in Yup:
for x in Xup:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.block_maze[y, x] = 1
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
def up_has_door(self,door_num):
Xup = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
Yup = [0]
Xup_d = [11, 12, 13, 14]
Yup_d = [0]
for y in Yup:
for x in Xup:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.block_maze[y, x] = 1
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in Xup_d:
for y in Yup_d:
self.door = Up_Door()
self.door.rect.left, self.door.rect.top = 3 + x * 24, 3 + y * 24
self.doorGroup.append(self.door)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = door_num
def bottom_no_door(self):
Xbottom = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
Ybottom = [25]
for y in Ybottom:
for x in Xbottom:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.block_maze[y, x] = 1
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
def bottom_has_door(self, door_num):
Xbottom = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
Ybottom = [25]
Xbottom_d = [11, 12, 13, 14]
Ybottom_d = [25]
for x in Xbottom:
for y in Ybottom:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in Xbottom_d:
for y in Ybottom_d:
self.door = Down_Door()
self.door.rect.left, self.door.rect.top = 3 + x * 24, 3 + y * 24
self.doorGroup.append(self.door)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = door_num
def left_no_door(self):
Xleft = [0]
Yleft = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
for x in Xleft:
for y in Yleft:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
def left_special_door(self,door_num):
Xleft = [0]
Yleft = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
Xleft_d = [0]
Yleft_d = [10, 11, 12, 13]
for x in Xleft:
for y in Yleft:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in Xleft_d:
for y in Yleft_d:
self.door = Special_Door()
self.door.rect.left, self.door.rect.top = 3 + x * 24, 3 + y * 24
self.doorGroup.append(self.door)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = door_num
def left_has_door(self,door_num):
Xleft = [0]
Yleft = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
Xleft_d = [0]
Yleft_d = [10, 11, 12, 13]
for x in Xleft:
for y in Yleft:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in Xleft_d:
for y in Yleft_d:
self.door = Left_Door()
self.door.rect.left, self.door.rect.top = 3 + x * 24, 3 + y * 24
self.doorGroup.append(self.door)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = door_num
def right_no_door(self):
Xright = [25]
Yright = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
for x in Xright:
for y in Yright:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
def right_special_door(self, door_num):
Xright = [25]
Yright = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
Xright_d = [25]
Yright_d = [10, 11, 12, 13]
for x in Xright:
for y in Yright:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in Xright_d:
for y in Yright_d:
self.door = Special_Door()
self.door.rect.left, self.door.rect.top = 3 + x * 24, 3 + y * 24
self.doorGroup.append(self.door)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = door_num
def right_has_door(self, door_num):
Xright = [25]
Yright = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
Xright_d = [25]
Yright_d = [10, 11, 12, 13]
for x in Xright:
for y in Yright:
self.block = Blocks()
self.block.rect.left, self.block.rect.top = 3 + x * 24, 3 + y * 24
self.blockGroup.append(self.block)
self.block_maze[y, x] = 1
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = 1
for x in Xright_d:
for y in Yright_d:
self.door = Right_Door()
self.door.rect.left, self.door.rect.top = 3 + x * 24, 3 + y * 24
self.doorGroup.append(self.door)
for xi in range(3 + x * 24, 27 + x * 24):
for yi in range(3 + y * 24, 27 + y * 24):
self.maze[xi, yi] = door_num
def fill_door(self):
for i in range(self.block_maze.shape[0]):
for j in range(self.block_maze.shape[1]):
if i != 0 and i != self.block_maze.shape[0] - 1 and j != 0 and j != self.block_maze.shape[1] - 1 and \
self.block_maze[i][j] == 1:
self.block_maze[i - 1][j] = 1
self.block_maze[i][j - 1] = 1
class Map0:
def __init__(self):
self.small_x = 634
self.small_y = 76
init_para(self)
map2_para(self)
make_wall2(self)
right_no_door(self)
left_has_door(self, 35)
up_has_door(self,32)
bottom_has_door(self,10)
fill_door(self)
def dcrease_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map1():
def __init__(self):
self.small_x = 634
self.small_y = 100
init_para(self)
map3_para(self)
make_wall3(self)
left_special_door(self,33)
up_has_door(self, 9)
bottom_has_door(self, 11)
right_has_door(self, 12)
fill_door(self)
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
def damage_enemy(self, num):
self.enemy_number -= num
class Map2():
def __init__(self):
self.small_x = 634
self.small_y = 124
init_para(self)
map1_para(self)
make_wall1(self)
bottom_no_door(self)
left_no_door(self)
right_no_door(self)
# 地图三上门
up_has_door(self, 10)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map3():
def __init__(self):
self.small_x = 658
self.small_y = 100
init_para(self)
map4_para(self)
# 建墙
make_wall4(self)
up_no_door(self)
bottom_no_door(self)
#地图四左右门
left_has_door(self, 10)
right_has_door(self, 13)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map4():
def __init__(self):
self.small_x = 682
self.small_y = 100
init_para(self)
map4_para(self)
# 建墙
make_wall4(self)
right_no_door(self)
#地图五左上下门
left_has_door(self, 12)
up_has_door(self, 14)
bottom_has_door(self, 20)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map5():
def __init__(self):
self.small_x = 682
self.small_y = 76
init_para(self)
map2_para(self)
# 建墙
make_wall2(self)
left_no_door(self)
up_no_door(self)
# 地图六下右门
bottom_has_door(self, 13)
right_has_door(self, 15)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map6():
def __init__(self):
self.small_x = 706
self.small_y = 76
init_para(self)
map4_para(self)
# 建墙
make_wall4(self)
bottom_no_door(self)
up_no_door(self)
# 地图七左右门
left_has_door(self, 14)
right_has_door(self, 16)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map7():
def __init__(self):
self.small_x = 730
self.small_y = 76
init_para(self)
map3_para(self)
# 建墙
make_wall3(self)
right_no_door(self)
up_no_door(self)
# 地图八左下门
left_has_door(self, 15)
bottom_has_door(self, 17)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map8():
def __init__(self):
self.small_x = 730
self.small_y = 100
init_para(self)
map2_para(self)
# 建墙
make_wall2(self)
left_no_door(self)
right_no_door(self)
# 地图九上下门
bottom_has_door(self, 18)
up_has_door(self, 16)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map9():
def __init__(self):
self.small_x = 730
self.small_y = 124
init_para(self)
map1_para(self)
# 建墙
make_wall1(self)
right_no_door(self)
bottom_no_door(self)
# 地图十上右门
left_has_door(self, 19)
up_has_door(self,17)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map10():
def __init__(self):
self.small_x = 706
self.small_y = 124
init_para(self)
map3_para(self)
# 建墙
make_wall3(self)
up_no_door(self)
# 地图十一下左右
bottom_has_door(self, 22)
right_has_door(self, 18)
left_has_door(self, 20)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map11():
def __init__(self):
self.small_x = 682
self.small_y = 124
init_para(self)
map2_para(self)
# 建墙
make_wall2(self)
left_no_door(self)
# 地图十二上下右门
bottom_has_door(self, 21)
up_has_door(self,13)
right_has_door(self, 19)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map12():
def __init__(self):
self.small_x = 682
self.small_y = 148
init_para(self)
map4_para(self)
# 建墙
make_wall4(self)
# 地图十三上下左右门
bottom_has_door(self, 24)
right_has_door(self, 22)
up_has_door(self, 20)
left_has_door(self, 23)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map13():
def __init__(self):
self.small_x = 706
self.small_y = 148
init_para(self)
map3_para(self)
# 建墙
make_wall3(self)
right_no_door(self)
bottom_no_door(self)
# 地图十四左上门
left_has_door(self, 21)
up_has_door(self, 19)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map14():
def __init__(self):
self.small_x = 658
self.small_y = 148
init_para(self)
map2_para(self)
# 建墙
make_wall2(self)
up_no_door(self)
bottom_no_door(self)
left_no_door(self)
# 地图十五右门
right_has_door(self, 21)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map15():
def __init__(self):
self.small_x = 682
self.small_y = 172
init_para(self)
map3_para(self)
# 建墙
make_wall3(self)
left_no_door(self)
right_no_door(self)
# 地图十六上下门
bottom_has_door(self, 25)
up_has_door(self, 21)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map16():
def __init__(self):
self.small_x = 682
self.small_y = 196
init_para(self)
map4_para(self)
# 建墙
make_wall4(self)
bottom_no_door(self)
# 地图十七上左右门
right_has_door(self, 29)
up_has_door(self,24)
left_has_door(self, 26)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map17():
def __init__(self):
self.small_x = 658
self.small_y = 196
init_para(self)
map3_para(self)
# 建墙
make_wall3(self)
up_no_door(self)
bottom_no_door(self)
# 地图十八左右门
right_has_door(self, 25)
left_has_door(self, 27)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map18():
def __init__(self):
self.small_x = 634
self.small_y = 196
init_para(self)
map2_para(self)
# 建墙
make_wall2(self)
left_no_door(self)
bottom_no_door(self)
# 地图十九上右门
right_has_door(self, 26)
up_has_door(self,28)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map19():
def __init__(self):
self.small_x = 634
self.small_y = 172
init_para(self)
map2_para(self)
# 建墙
make_wall2(self)
left_no_door(self)
right_no_door(self)
# 地图二十上下门
bottom_has_door(self, 27)
up_has_door(self, 32)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map20():
def __init__(self):
self.small_x = 704
self.small_y = 196
init_para(self)
map3_para(self)
# 建墙
make_wall3(self)
up_no_door(self)
bottom_no_door(self)
# 地图二十一左右门
right_has_door(self, 30)
left_has_door(self, 25)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map21():
def __init__(self):
self.small_x = 730
self.small_y = 196
init_para(self)
map1_para(self)
# 建墙
make_wall1(self)
up_no_door(self)
right_no_door(self)
# 地图二十二左下门
bottom_has_door(self, 31)
left_has_door(self, 29)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map22():
def __init__(self):
self.small_x = 730
self.small_y = 220
init_para(self)
map2_para(self)
# 建墙
make_wall2(self)
left_no_door(self)
right_no_door(self)
# 地图二十三上下门
bottom_has_door(self, 32)
up_has_door(self, 30)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
class Map23():
#Boss 房间
def __init__(self):
self.small_x = 693
self.small_y = 560
init_para(self)
map5_para(self)
# 建墙
make_wall5(self)
right_no_door(self)
# boss房门
bottom_has_door(self, 28)
up_has_door(self, 31)
left_special_door(self, 36)
# 填充门
fill_door(self)
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
#减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
#加敌函数
def increase_enemy(self, num):
self.enemy_number += num
#隐藏地图
class Map24():
def __init__(self):
self.small_x = 689
self.small_y = 355
init_para(self)
map6_para(self)
self.steady_buff.append(Buff.BuffStuff(315, 315, 4))
# 建墙
make_wall6(self)
up_no_door(self)
bottom_no_door(self)
left_no_door(self)
# 隐藏关卡门
right_special_door(self, 10)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
#初始地图
class Map25():
def __init__(self):
self.small_x = 685
self.small_y = 355
self.enemy_number = 0
self.doorGroup = list()
self.traps = list()
self.enemies = list()
self.steady_buff = list()
self.blockGroup = list()
self.size = 24
self.maze = np.zeros(shape=(630, 630))
self.block_maze = np.zeros(shape=(26, 26)) # 缩小版的maze, 1 为 墙, 0 为 可通行区域
self.sound = pygame.mixer.Sound("sound/soundtrack/Eclipse.mp3")
self.sound.set_volume(0.4)
self.over = True
# 建墙
'''make_wall7(self)'''
up_no_door(self)
bottom_no_door(self)
left_no_door(self)
# 隐藏关卡门
right_has_door(self, 35)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
#走廊
class Map26():
def __init__(self):
self.small_x = 685
self.small_y = 370
self.enemy_number = 0
self.doorGroup = list()
self.traps = list()
self.enemies = list()
self.steady_buff = list()
self.blockGroup = list()
self.size = 24
self.maze = np.zeros(shape=(630, 630))
self.block_maze = np.zeros(shape=(26, 26)) # 缩小版的maze, 1 为 墙, 0 为 可通行区域
self.sound = pygame.mixer.Sound("sound/soundtrack/Eclipse.mp3")
self.sound.set_volume(0.4)
self.over = True
# 建墙
make_wall8(self)
up_no_door(self)
bottom_no_door(self)
# 走廊左右门
left_has_door(self, 34)
right_has_door(self, 9)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
#结束走廊
class Map27():
def __init__(self):
self.small_x = 685
self.small_y = 370
self.enemy_number = 0
self.doorGroup = list()
self.traps = list()
self.enemies = list()
self.steady_buff = list()
self.blockGroup = list()
self.size = 24
self.maze = np.zeros(shape=(630, 630))
self.block_maze = np.zeros(shape=(26, 26)) # 缩小版的maze, 1 为 墙, 0 为 可通行区域
self.sound = pygame.mixer.Sound("sound/soundtrack/Eclipse.mp3")
self.sound.set_volume(0.4)
self.over = True
# 建墙
make_wall9(self)
up_no_door(self)
bottom_no_door(self)
# 走廊左右门
left_has_door(self, 34)
right_has_door(self, 32)
# 填充门
fill_door(self)
# 减敌函数
def damage_enemy(self, num):
self.enemy_number -= num
def play_back(self):
self.sound.play(-1)
def stop_play(self):
self.sound.stop()
# 新添加---------------------------------------------------------------------------------
class Map28():
def __init__(self):
SmallMap(self)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。