def end_game(): txt="Obca cywilizacja jest pod wrażeniem twoich dokonań, zapraszają Cię do wspólnej podrózy w kierunku anomalii" ui.print_text(txt,font_color=33) img= ui.get_ascii("./ascii_files/alien_head.txt") ui.display_ascii(img,font_colors=[32], spacing=5) input("=>") os.system('memes\Twardowsky2.png')
def end_game(end): title = 0 end_story = 1 if end == "die": ui.display_ascii(end_screen["die"][title]) ui.display_dialog_window(end_screen["die"][end_story]) elif end == "win": ui.display_ascii(end_screen["win"][title]) ui.display_dialog_window(end_screen["win"][end_story])
def ferdek(player): x = player['player_x_position'] y = player['player_y_position'] if x == 1 and y == 4: txt=("Tu nie ma pracy dla ludzi z moim wykształceniem") ui.print_text(txt,font_color=36) im = ui.get_ascii("./ascii_files/ferdek.txt") #import text from ASCII file ui.display_ascii(im,font_colors=[37],spacing=5) #displays ASCII file with color defined by number input(" ") os.system('cls')
def level_2_start(): maze = ui.get_ascii("./ascii_files/maze.txt") #import text from ASCII file ui.display_ascii(maze,font_colors=[31],spacing=1) #displays ASCII file with color defined by number input() util.clear_screen() input(''' "(...) wyższa cywilizacja przyjeżdża tymi UF-ami i innymi i przygląda się: co oni tu wyprawiają." \u001b[36;1mLech Wałęsa\u001b[0m ''') util.clear_screen() input(""" Znajdź w kosmicznym labiryncie 8 gwiazdek (★ ★ ★ ★ ★ ★ ★ ★) i sprostaj wyzwaniom jakie stawiają obce cywilizacje!""") util.clear_screen()
def exchange_of_goods(player, inventory): x = player['player_x_position'] y = player['player_y_position'] if x == 9 and y == 13: im = ui.get_ascii("./ascii_files/meta.txt") #import text from ASCII file ui.display_ascii(im,font_colors=[37],spacing=5) #displays ASCII file with color defined by number txt=("Cześć, chcesz wymienić bigos i pierogi na ODLOTOWY PREPARAT?") ui.print_text(txt,font_color=36) choice = input("T / N: ") os.system('cls') if choice == "t": if inventory["Pierogi"] > 0 and inventory["Bigos"] > 0: inventory["Pierogi"] -= 1 inventory["Bigos"] -= 1 inventory["Ropa"] += 1 return inventory if choice == "n": return inventory else: return inventory
def get_blasters(player, inventory): x = player['player_x_position'] y = player['player_y_position'] if x == 2 and y == 1: txt=("Czekasz w kolejce do pokoju, po chwili słyszysz swoje nazwisko i wchodzisz do środka") ui.print_text(txt,font_color=36) input(" ") os.system('cls') im = ui.get_ascii("./ascii_files/urzednik.txt") #import text from ASCII file ui.display_ascii(im,font_colors=[37],spacing=5) #displays ASCII file with color defined by number input(" ") txt=("Po obszernym wywiadzie dotyczącym Twojej sytuacji zawodowej otrzymujesz zasiłek dla bezrobotnych") ui.print_text(txt,font_color=36) input(" ") os.system('cls') im = ui.get_ascii("./ascii_files/banknoty.txt") #import text from ASCII file ui.display_ascii(im,font_colors=[32],spacing=5) #displays ASCII file with color defined by number input(" ") os.system('cls') txt=("Odpalasz swojego smatrfona i kupujesz blastery do startku") ui.print_text(txt,font_color=36) input(" ") im = ui.get_ascii("./ascii_files/allezlo.txt") #import text from ASCII file ui.display_ascii(im,font_colors=[32],spacing=5) #displays ASCII file with color defined by number input(" ") os.system('cls') inventory["Działko"] += 1 return inventory else: return inventory
def going_to_the_moon(): txt=("Spotykasz typowego Sebę. Który pyta czy masz jakiś problem?\nPo krótkiej wymianie zdań, postanawia ci pomóc...") ui.print_text(txt,font_color=36) im = ui.get_ascii("./ascii_files/ziomek.txt") #import text from ASCII file ui.display_ascii(im,font_colors=[37],spacing=5) #displays ASCII file with color defined by number input() os.system('cls') txt="Ruszamy w kosmos!" ui.print_text(txt,font_color=36) im = ui.get_ascii("./ascii_files/gulf.txt") #import text from ASCII file ui.display_ascii(im,font_colors=[37],spacing=5) #displays ASCII file with color defined by number input() os.system('cls') txt=("Trzeciego dnia podróży postanawiacie wypić wódkę zabraną przez Twojego kompana i zasypiacie. Budzicie się a Waszym oczom ukazuje się wileki labirynt!") ui.print_text(txt,font_color=36) im = ui.get_ascii("./ascii_files/flaszka.txt") #import text from ASCII file ui.display_ascii(im,font_colors=[37],spacing=5) #displays ASCII file with color defined by number input()
def main(): player = create_player() board = engine.create_board(BOARD_WIDTH, BOARD_HEIGHT) util.clear_screen() level = 1 inventory = { "Pierogi": 5, "Bigos": 5, "Złom": 5, "Sliptape": 5, "Ropa": 5, "Działko": 5 } if level == 1: # import text from ASCII file title = ui.get_ascii("./ascii_files/poland_can_into_space.txt") # displays ASCII file with color defined by number ui.display_ascii(title, font_colors=[34], spacing=5) input(" ") os.system('cls') print("\n\n") txt = "Rok 2030. Trwa wyścig światowych mocarstw o każdy kawłek lądu. Pewnej nocy na niebie pojawia się tajemnicza anomalia... " ui.print_text(txt, font_color=33) # import text from ASCII file anomaly = ui.get_ascii("./ascii_files/saturn.txt") # displays ASCII file with color defined by number ui.display_ascii(anomaly, font_colors=[35], spacing=5) input(" ") os.system('cls') # import text from ASCII file im = ui.get_ascii("./ascii_files/roz1.txt") # displays ASCII file with color defined by number ui.display_ascii(im, font_colors=[31], spacing=1) input(" ") os.system('cls') txt = (''' Po Twojej głowie wędruje wyłącznie jedna myśl. To jest mój czas. Muszę polecieć i zbadać tajemniczą anomalię. Postanawiasz przerobić swojego Golfa 1.9 TDI pieszczotliwie nazywanego Gulfem na statek kosmiczny i niezwłocznie wyruszyć w drogę.''' ) ui.print_text(txt, font_color=33) input(" ") os.system('cls') mum_house = engine.generate_game_board_1(board) is_running = True while is_running: x = player['player_x_position'] y = player['player_y_position'] engine.add_to_inventory(player, mum_house, inventory) temporary_board = deepcopy(mum_house) engine.put_player_on_board(temporary_board, player) ui.display_board(temporary_board) engine.display_players_card(inventory) # print(f"Player position: ({x},{y})") key = util.key_pressed() if key == 'q': is_running = False else: engine.player_moves(key, mum_house, player) util.clear_screen() pass_condition = engine.chceck_inventory(inventory, level) if engine.exit_board(level, player) == True: if pass_condition == True: is_running = False level = 2 else: is_running = True if level == 2: txt = ( '''Wyszedłeś na miasto. Uzupełnij zasoby, zdobądź paliwo, osłony i działa do statku.''' ) ui.print_text(txt, font_color=33) input(" ") os.system('cls') city = engine.generate_game_board_2(board) is_running = True while is_running: x = player['player_x_position'] y = player['player_y_position'] engine.add_to_inventory(player, city, inventory) temporary_board = deepcopy(city) engine.put_player_on_board(temporary_board, player) ui.display_board(temporary_board) engine.display_players_card(inventory) # print(f"Player position: ({x},{y})") key = util.key_pressed() if key == 'q': is_running = False else: engine.player_moves(key, city, player) util.clear_screen() inventory = engine.exchange_of_goods(player, inventory) engine.ferdek(player) inventory = engine.get_blasters(player, inventory) pass_condition = engine.chceck_inventory(inventory, level) if engine.exit_board(level, player) == True: if pass_condition == True: engine.going_to_the_moon() level = 3 is_running = False elif engine.exit_board(level, player) == False: is_running = True if level == 3: player['player_x_position'] = PLAYER_START_X player['player_y_position'] = PLAYER_START_Y board = engine.create_board(21, 15) util.clear_screen() board_level_2 = engine.maze_generator(board) engine.put_quizzes(board_level_2) engine.put_memes(board_level_2) is_running = True level_2 = True while is_running: engine.level_2_start() while level_2: engine.quiz_function(board_level_2, player) engine.meme_function(board_level_2, player) temporary_board = deepcopy(board_level_2) engine.put_player_on_board(temporary_board, player) engine.display_maze_status(player) ui.display_maze(temporary_board, player) key = util.key_pressed() if key == 'q': is_running = False else: engine.player_moves(key, temporary_board, player) util.clear_screen() level_4 = player['player_*'] if level_4 > 7: level = 4 is_running = False level_2 = False if level == 4: txt = ( "Po latach podrózy i licznych przeszkodach na horyzoncie ukazuje się anomalia. Aby do niej dotrzeć musisz zmierzyć się z obcymi..." ) ui.print_text(txt, font_color=33) input() os.system("cls||clear") level_3 = True player['player_x_position'] = PLAYER_START_X player['player_y_position'] = PLAYER_START_Y board_level_3 = engine.create_board(BOARD_WIDTH_lvl3, BOARD_HEIGHT_lvl3) im = ui.get_ascii( "./ascii_files/battle.txt") #import text from ASCII file ui.display_ascii( im, font_colors=[31], spacing=1) #displays ASCII file with color defined by number input() os.system('cls') counter = 0 engine.intro_lvl3() while level_3: counter += 1 temporary_board = deepcopy(board_level_3) engine.put_player_on_board(temporary_board, player) level_3 = engine.play_level3(temporary_board, player, counter) if level_3: ui.display_board(temporary_board) is_running = False util.clear_screen() level = 5 if level == 5: engine.end_game()
def play_level3(temporary_board,player,counter): global enemy_state,enemy_shots_quantity x = player['player_x_position'] y = player['player_y_position'] print("PLAYER LIFE: ","".join(player_live),"\t\t\t\t\t","ALIEN LIFE: ","".join(alien_live)) PLAYER_SHOT_ICON= ALKO_ICON#[PLAYER_SHOT1_ICON, PLAYER_SHOT2_ICON] if enemy_state<1: temporary_board[2][10] = PLAYER_SHOT_ICON[0] elif enemy_state==1: temporary_board[1][20] = PLAYER_SHOT_ICON[1] elif enemy_state>1: temporary_board[2][3] = PLAYER_SHOT_ICON[2] if enemy_state<1: enemy= ui.get_ascii("./ascii_files/alien_standing.txt") ui.display_ascii(enemy,font_colors=[32], spacing=5) elif enemy_state==1: enemy= ui.get_ascii("./ascii_files/alien_in_ufo.txt") ui.display_ascii(enemy, spacing=(counter%10)) elif enemy_state>1: enemy = ui.get_ascii("./ascii_files/enemy2.txt") display_ascii_with_move(enemy,counter,7,[30,31,33]) key = util.key_pressed() if key == 'q': input("You left the game") return False else: player_moves(key, temporary_board, player) util.clear_screen() #generate PLAYER shot if temporary_board[x][y] in PLAYER_SHOT_ICON: shot_result = level3_shot() player['player_x_position'] = main.PLAYER_START_X player['player_y_position'] = main.PLAYER_START_Y if shot_result: if enemy_state==0: enemy_shots_quantity = ENEMY_SHOTS_NUMBER first_shot() elif enemy_state==1: txt = "Po przejściu na wino, przeciwnik ma probnlemy z kontrolą lotu. Zwycięstwo jest blisko!" ui.print_text(txt,font_color=33) enemy_state+=1 del alien_live[-1] #generate and puts on board enemy shots enemy_shots_position = list(get_random_position(temporary_board,enemy_shots_quantity)) for position in enemy_shots_position: temporary_board[position[0]][position[1]] = ENEMY_SHOT_ICON if (position[0],position[1])==(x,y): txt=("Mały zielony kosmita wygrywa starcie. Po rozmowie z Posejdonem wracasz do walki.") ui.print_text(txt,font_color=33) input() player['player_x_position'] = main.PLAYER_START_X player['player_y_position'] = main.PLAYER_START_Y del player_live[-1] break if len(alien_live)==0: img= ui.get_ascii("./ascii_files/koniec.txt") ui.display_ascii(img,font_colors=[31], spacing=0) input() return False elif len(player_live)==0 or counter >200: input("Poległeś w walce !") return False else: return True
def first_shot(): txt=("Potrzymaj mi piwo! I patrz!!!\n") ui.print_text(txt,font_color=36) enemy= ui.get_ascii("./ascii_files/alien_sitting_to_ufo.txt") ui.display_ascii(enemy,font_colors=[32], spacing=7)