Try something like this to check the file exists before you try to load it:-
or you could just do this, which will cover you if the file exists but does not load correctly:-
Steve.
local sFileName:string="graphics\stage"+Level+".png" if filetype(sFileName)=1 then BackgroundImage = LoadImage(sFileName) else BackgroundImage = LoadImage("stage1.png") endif
or you could just do this, which will cover you if the file exists but does not load correctly:-
local sFileName:string="graphics\stage"+Level+".png" BackgroundImage = LoadImage(sFileName) if not BackgroundImage then BackgroundImage = LoadImage("stage1.png") endif
Steve.