creating a second game level?

Blitz3D Forums/Blitz3D Beginners Area/creating a second game level?

Lordon(Posted 2004) [#1]
im trying to get the game to remake the world into the second level at a given point. ive got teh first world teh way i want it, after you trigger an event, it goes to a label: "leveltwo"

after the label, it ends the graphics mode and remakes everything. but when i run it i get: "memory access violation"

is there a better way to do this? maybe make a second program and call it when the player completes the first one?


Warren(Posted 2004) [#2]
You're forgetting to reload something. When you change the graphics mode, everything is flushed from the video card. Any texture ids that you saved are all now invalid and you need to reload the textures and grabs their new ids.


Gabriel(Posted 2004) [#3]
Turn debug mode on.


Warren(Posted 2004) [#4]
...which will show you the line it's crashing on, and hence tell you what isn't being reloaded.


Lordon(Posted 2004) [#5]
ok, it works now, thx for yur help =]


WolRon(Posted 2004) [#6]
An alternative method may be to not perform a new Graphics command but just reuse some of the already loaded elements and discard (FreeEntity, FreeImage, etc.) the ones that you don't need. This may execute a lot faster and will not require a (annoying) screen resolution switch.


jhocking(Posted 2004) [#7]
I have an EndLevel function that clears all the loaded assets (ClearWorld for clearing graphics without switching graphics mode, FreeEntity for other stuff, Delete/Each for types) at the end of each level.