My game has a different background image for each stage. So far, this is the simplest way I can think of to load it:
It works very nicely, as long as the image it's searching for exists. I don't like the way it fails, though, if the file doesn't exist. (Unhandled Memory Exception Error. Ewwww!)
Is there any way I can check to ensure the png file exists before I try to load it? Perhaps using stage1.png as a handy default image, if the correct png file can not be found? It's not like I plan on releasing the game without as many images as there are stages... I'd just really feel a LOT more comfortable with a default image behavior, as opposed to an abrupt crash.
BackgroundImage = LoadImage("graphics\stage"+Level+".png")
It works very nicely, as long as the image it's searching for exists. I don't like the way it fails, though, if the file doesn't exist. (Unhandled Memory Exception Error. Ewwww!)
Is there any way I can check to ensure the png file exists before I try to load it? Perhaps using stage1.png as a handy default image, if the correct png file can not be found? It's not like I plan on releasing the game without as many images as there are stages... I'd just really feel a LOT more comfortable with a default image behavior, as opposed to an abrupt crash.