优化毁灭菇种植判断
This commit is contained in:
parent
ae58d15e18
commit
80fdac7220
@ -909,11 +909,10 @@ class Level(tool.State):
|
||||
elif self.plant_name == c.TANGLEKLEP:
|
||||
new_plant = plant.TangleKlep(x, y)
|
||||
elif self.plant_name == c.DOOMSHROOM:
|
||||
if ((self.map_data[c.BACKGROUND_TYPE] in c.ON_ROOF_BACKGROUNDS) or
|
||||
(self.map_data[c.BACKGROUND_TYPE] in c.POOL_EQUIPPED_BACKGROUNDS)):
|
||||
new_plant = plant.DoomShroom(x, y, self.map.map[map_y][map_x][c.MAP_PLANT], explode_y_range=3)
|
||||
else:
|
||||
if self.map.gridHeightSize == c.GRID_Y_SIZE:
|
||||
new_plant = plant.DoomShroom(x, y, self.map.map[map_y][map_x][c.MAP_PLANT], explode_y_range=2)
|
||||
else:
|
||||
new_plant = plant.DoomShroom(x, y, self.map.map[map_y][map_x][c.MAP_PLANT], explode_y_range=3)
|
||||
elif self.plant_name == c.GRAVEBUSTER:
|
||||
new_plant = plant.GraveBuster(x, y, self.plant_groups[map_y], self.map, map_x)
|
||||
elif self.plant_name == c.FUMESHROOM:
|
||||
|
||||
@ -97,8 +97,10 @@ class Menu(tool.State):
|
||||
# 高亮冒险模式按钮
|
||||
if self.inAreaAdventure(x, y):
|
||||
self.adventure_highlight_time = self.current_time
|
||||
# 高亮退出按钮
|
||||
elif self.inAreaExit(x, y):
|
||||
self.exit_highlight_time = self.current_time
|
||||
# 高亮小游戏按钮
|
||||
elif self.inAreaLittleGame(x, y):
|
||||
self.littleGame_highlight_time = self.current_time
|
||||
|
||||
@ -126,8 +128,6 @@ class Menu(tool.State):
|
||||
x, y = mouse_pos
|
||||
if self.inAreaLittleGame(x, y):
|
||||
self.done = True
|
||||
# 确实小游戏还是用的level
|
||||
# 因为目前暂时没有生存模式和解谜模式,所以暂时设置为这样
|
||||
self.persist[c.GAME_MODE] = c.MODE_LITTLEGAME
|
||||
# 播放点击音效
|
||||
pg.mixer.Sound(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ,"resources", "sound", "buttonclick.ogg")).play()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user