[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] "Try" For World Loading



I'm working on a system for loading parts of the game world as "zones" with names determined by coordinates. If the player moves outside a zone, the game will look for a zone with a certain name to load it. But the file for that zone might not exist. I'm about to write the function so that it uses the "try" statement to look for the file. Is that bad for some reason, or even "bad form?" Is there a reason to do things a different way, namely looking at a list of all files and saying "if desired_filename in list_of_files, load?"

Kris