elif command == "CLAIMED": claimed = sprite_uuid_map[split_input[2]] if split_input[1] == client_networking.client_uuid: # this means we got it claimed.execute_claim(player) else: # this means we didn't claimed.execute_claim(opponent) elif command == "COMPLETE": print "Cast of", sigil_deserialize(split_input[1]).name, "complete" elif command == "REMOVE": print "Removing sigil", split_input[1] sprite_uuid_map[split_input[1]].remove() elif command == "HEALTH": if split_input[1] == client_networking.client_uuid: player.health = int(split_input[2]) else: opponent.health = int(split_input[2]) # every 3 seconds we'll look for sigils off the screen and clean them up if sigil_appearance_count % 180 == 0: out_of_bounds = [s for s in game_state.available_sprites if s.rect.x <= -150] for sigil in out_of_bounds: game_state.available_sprites.remove(sigil) sigil_appearance_count += 1 # update all sprites and draw the UI, also keep the framerate synced game_state.all_sprites.update() game_state.sigil_overlay_sprites.update() screen.blit(generate_ui(), (0, 0)) game_state.all_sprites.draw(screen) game_state.sigil_overlay_sprites.draw(screen)