diff --git a/resources/data/map/level_0.json b/resources/data/map/level_0.json index 1e51b9e..d762f2d 100644 --- a/resources/data/map/level_0.json +++ b/resources/data/map/level_0.json @@ -19,4 +19,4 @@ {"time":0, "map_y":2, "name":"ConeheadDuckyTubeZombie"}, {"time":90000, "map_y":2, "name":"ConeheadDuckyTubeZombie"} ] -} \ No newline at end of file +} diff --git a/resources/data/map/level_1.json b/resources/data/map/level_1.json index 0883186..d2c13ec 100644 --- a/resources/data/map/level_1.json +++ b/resources/data/map/level_1.json @@ -5,4 +5,4 @@ "spawn_zombies":"auto", "included_zombies":["Zombie"], "num_flags":2 -} \ No newline at end of file +} diff --git a/resources/data/map/level_2.json b/resources/data/map/level_2.json index baa5fbf..f16411a 100644 --- a/resources/data/map/level_2.json +++ b/resources/data/map/level_2.json @@ -5,4 +5,4 @@ "spawn_zombies":"auto", "included_zombies":["Zombie", "ConeheadZombie", "PoleVaultingZombie"], "num_flags":3 -} \ No newline at end of file +} diff --git a/resources/data/map/littleGame_1.json b/resources/data/map/littleGame_1.json index c598f41..b5f5f52 100644 --- a/resources/data/map/littleGame_1.json +++ b/resources/data/map/littleGame_1.json @@ -15,4 +15,4 @@ {"name":"Chomper"}, {"name":"PotatoMine"} ] -} \ No newline at end of file +} diff --git a/resources/data/map/littleGame_2.json b/resources/data/map/littleGame_2.json index 948e572..7ac1303 100644 --- a/resources/data/map/littleGame_2.json +++ b/resources/data/map/littleGame_2.json @@ -10,4 +10,4 @@ {"name":"WallNutBowling"}, {"name":"RedWallNutBowling"} ] -} \ No newline at end of file +} diff --git a/source/component/zombie.py b/source/component/zombie.py index c697f51..ce9a63f 100755 --- a/source/component/zombie.py +++ b/source/component/zombie.py @@ -18,7 +18,7 @@ class Zombie(pg.sprite.Sprite): self.image = self.frames[self.frame_index] self.mask = pg.mask.from_surface(self.image) self.rect = self.image.get_rect() - self.rect.centerx = x + self.rect.x = x self.rect.bottom = y self.helmetHealth = helmetHealth diff --git a/source/constants.py b/source/constants.py index 72a21f0..210bcbc 100755 --- a/source/constants.py +++ b/source/constants.py @@ -3,6 +3,9 @@ START_LEVEL_NUM = 1 # 小游戏模式起始关卡 START_LITTLE_GAME_NUM = 1 +# 游戏速度倍率(调试用) +GAME_RATE = 1 + # 窗口标题 ORIGINAL_CAPTION = 'pypvz' @@ -33,9 +36,6 @@ GRID_ROOF_Y_LEN = GRID_Y_LEN GRID_ROOF_X_SIZE = GRID_X_SIZE GRID_ROOF_Y_SIZE = 85 -# 游戏速度倍率(调试用) -GAME_RATE = 1 - # 颜色 WHITE = (255, 255, 255) NAVYBLUE = ( 60, 60, 100) @@ -441,7 +441,7 @@ ZOMBIE_ATTACK_DAMAGE = 50 ZOMBIE_WALK_INTERVAL = 60 # 僵尸步行间隔 # 僵尸生成位置 -ZOMBIE_START_X = SCREEN_WIDTH + 50 # 场宽度不一样,用于拟合 +ZOMBIE_START_X = SCREEN_WIDTH + 30 # 场宽度不一样,用于拟合 # 僵尸集体属性集合 @@ -463,9 +463,10 @@ CREATE_ZOMBIE_DICT = { # 生成僵尸:(级别, 权重) # 记录陆生僵尸的水生变种 CONVERT_ZOMBIE_IN_POOL = { - NORMAL_ZOMBIE: DUCKY_TUBE_ZOMBIE, - CONEHEAD_ZOMBIE: CONEHEAD_DUCKY_TUBE_ZOMBIE, - BUCKETHEAD_ZOMBIE: BUCKETHEAD_DUCKY_TUBE_ZOMBIE} + NORMAL_ZOMBIE: DUCKY_TUBE_ZOMBIE, + CONEHEAD_ZOMBIE: CONEHEAD_DUCKY_TUBE_ZOMBIE, + BUCKETHEAD_ZOMBIE: BUCKETHEAD_DUCKY_TUBE_ZOMBIE + } # 水上僵尸集合 WATER_ZOMBIE = { diff --git a/source/state/level.py b/source/state/level.py index 3bbb761..656a08c 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -819,7 +819,7 @@ class Level(tool.State): self.zombie_groups[map_y].add(zombie.PoleVaultingZombie(c.ZOMBIE_START_X + randint(70, 80) + hugeWaveMove, y, self.head_group)) elif name == c.ZOMBONI: # 冰车僵尸生成位置不同 - self.zombie_groups[map_y].add(zombie.Zomboni(c.ZOMBIE_START_X + randint(55, 65) + hugeWaveMove, y, self.plant_groups[map_y], self.map, plant.IceFrozenPlot)) + self.zombie_groups[map_y].add(zombie.Zomboni(c.ZOMBIE_START_X + randint(0, 10) + hugeWaveMove, y, self.plant_groups[map_y], self.map, plant.IceFrozenPlot)) # 能否种植物的判断: # 先判断位置是否合法 isValid(map_x, map_y)