def new_bg(self, screen): self.bg=pygame.image.load("bg/"+menu.imagemenu(screen, Preview("Grass_BG.png"), Preview("Desert_BG.png"), Preview("Boss_BG.png"), Preview("Ghost_BG.png"), Preview("Snow_BG.png"), Preview("Volcano_BG.png"), Preview("Cave_BG.png"), Preview("Mountain_BG.png")))
kind=objects.SmallMario elif event.key==ord("n"): current_room.new_bg(screen) elif event.key==ord("g"): current_room.music=menu.textmenu(screen, "Enter music filename:") elif event.key==pygame.K_DELETE: del current_room.objs[-1] elif event.key==pygame.K_w: selected=current_room.objs.pop() selected.rect.top-=5 current_room.objs.append(selected) elif event.key==ord("t"): kind=None tile=menu.imagemenu(screen, Tile.Tile("grass", "images/grasstile.png", 72), Tile.Tile("dark", "images/DarkLand.png", 72), Tile.Tile("desert", "images/DesertTile.png", 72), Tile.Tile("desertBlock", "images/DesertBlock.png", 72), Tile.Tile("ghostBlock", "images/GhostBlock.png", 72), Tile.Tile("snow", "images/SnowBlock.png", 72), Tile.Tile("volcano", "images/VolcanoBlock.png", 72), Tile.Tile("cave", "images/UndergroundTile.png", 72), Tile.Tile("airshipHole", "images/AirshipCannonHole.png", 24), Tile.Tile("airshipBarrel", "images/AirshipBarrel.png", 50)) elif event.type==pygame.MOUSEBUTTONDOWN: if kind!=None: x, y=pygame.mouse.get_pos() current_room.add_object(x, y, kind) if kind.single:kind=None elif tile!=None: x, y=pygame.mouse.get_pos() current_room.add_tile(tile, [x, y]) if q:pygame.quit();sys.exit()
def object_menu(self, screen): x=[i(0,0) for i in objs_dict.values()] x.insert(0, screen) kind=objs_dict[menu.imagemenu(*x)] return kind