def mainAct(pl): clear() choice = pMenu([ 'hunt', 'move', 'heal', 'party', 'shop', 'dex', 'bank', pl.name, 'save', 'leave', ]) if choice == 'hunt': if not pl.countawake(): clear() print pl.name + ' is out of usable pokemon!' xxx = raw_input('\n\npress enter') else: hunt(pl) if choice == 'party': party(pl) if choice == pl.name: clear() print 'Status\n\n' print pl.name + ' $' + str(pl.money) for bt in pl.balls: if pl.balls[bt] > 0: print bt + ': ' + str(pl.balls[bt]) print '\n' raw_input('enter to return') return 0 if choice == 'shop': shop(pl) if choice == 'heal': heal(pl) if choice == 'dex': dexui(pl) if choice == 'bank': bank(pl) if choice == 'save': save(pl) if choice == 'leave': return 1 if choice == 'move': move(pl)
map_x = party.location_x + (screen_x-6) map_y = party.location_y + (screen_y-6) if map_x < 0 or map_x >= current_map.x_size or map_y < 0 or map_y >= current_map.y_size: tile = img_wat else: # print(f"Party {party.location_x},{party.location_y}") # print(f"{map_x}, {map_y} : {current_map.x_size}, {current_map.y_size}") tile = tile_map[current_map.terrain(map_x, map_y )] screen.blit(tile,(screen_x*50,screen_y*50)) amap = maps.maps() aparty = party.party() pygame.init() screen = pygame.display.set_mode((x_size, y_size)) pygame.display.set_caption('Game') pygame.mouse.set_visible(0) img_ld, r_rect = load_image("c:\\assets\\grass.png") img_wat, rect = load_image("c:\\assets\\water.png") img_mtn, rect = load_image("c:\\assets\\mountain.png") tile_map = {'water':img_wat, 'mountain':img_mtn, 'grass':img_ld} background = pygame.Surface(screen.get_size()) background = background.convert() background.fill((250, 250, 250)) pygame.display.flip()
q2 = que.Queue() q3 = que.Queue() #Initialization.. #TCP_IP = '192.168.100.246' #TCP_PORT = 62 UDP_PORT2 = 3000 server_info = ips.party_addr[pnr] #(TCP_IP, TCP_PORT) server2_info = (ipv4, UDP_PORT2) # Create new threads.. t1_comms = commsThread(1, "Communication Thread", server_info, q) #t2_commsSimulink = UDPcommsThread(2, "t2_commsSimulink", server2_info) ploting = plotter(q3) ploting.start() p = party(F, int(x), n, t, pnr, q, q2, q3, ips.party_addr, ips.server_addr) # Start new Threads #t2_commsSimulink.start() t1_comms.start() for i in ips.party_addr: while True: try: sock.TCPclient(i[0], i[1], ['flag', 1]) break except: time.sleep(1) continue p.start()
import maps import party if __name__ == "__main__": a_party = party.party() amap = maps.maps() status_location = "Location %d, %d - Terrain %s" status_party = "%s, HP - %d" print("Welcome to game") while True: print( status_location % (a_party.location_x, a_party.location_y, amap.terrain(a_party.location_x, a_party.location_y))) print( status_party % (a_party.party[0]["name"], a_party.party[0]["hp"])) inp = input() amap.navigate(inp, a_party)