Still no closer to spotting this - I have included the level load function source here :
Function _Load_Level()
`
` Determine which level we are working with
`
If Player = 1
Level = Player1Level
Else
Level = Player2Level
Endif
`
` Get collision zone images
`
_Get_Zones()
`
` Assign collision zone images to sprites
`
_Assign_Zones()
`
`
` Hide collision zone images from display
_Hide_Zones()
`
` Determine which folder to go looking for level background and foregrounds
`
If GameMode = 1
LevelFolder$ = "LevelsClassic"
Else
LevelFolder$ = "LevelsEnhanced"
Endif
`
` Construct filename to load for background and foreground
`
BackImage$ = LevelFolder$ + Right$("00" + Str$(Level),2) + "Back.png"
ForeImage$ = LevelFolder$ + Right$("00" + Str$(Level),2) + "Fore.bmp"
`
` Load the images
`
Load Image BackImage$, 3000, 1
Load Image ForeImage$, 3001, 1
EndFunction
I can manually set the Player1Level variable to 2 and it will successfully load the second level when the game starts.
If I let the game do it itself (as in add 1 to the Player1Level variable and call this function), I recieve the runtime error I referred to in my earlier post.
The difference here is I am not loading the bitmap anymore I am just trying to load two images that I know exist and in fact do load the first time through if I manually set the variable player1level.
It's beginning to drive me around the twist!!