Hey, Pete!
- Posted by Brian Jackson <bjackson at PRINTINGINC.COM> Oct 16, 1998
- 532 views
Pete, I've been working on a few modifications to gamedemo.ex which you posted to the list a couple of weeks ago. The problem I've run into is loading a new screen (that is, the good guy walked all the way across the first one...) I tried making the game_loop function re-entrant by adding these lines free_command(level_cmd) free_command(gamebar_cmd) -- one I added. free_command(back_cmd) free_screen(back_buffer) to the end of the procedure, and then reloading the level. The main routine looks like this: ------------------------------------------------------------------------ ---- -----------------------------------MAIN--------------------------------- ---- if gfx_mode(800,600,8) then FATALERROR("Your computer can't display 8-bit SVGA graphics") end if load_data() -- just some precursory info init_sprites() -- just the good guy for now load_level("levels\\21.lev") load_gamebar() while 1 do game_loop() load_level(level_name) load_gamebar() end while restore_mode() When I execute the program, it works fine for a few screens, but then after about 4 or 5 screens, it always generates a causeway error. I was wondering if you give me a few pointers on how to trap this nasty little bug since you've probably had 1 or 2 yourself. If you want to see the source code, I'll send by private e-mail as it's too large for the list. Thanks. deuce bjackson at printinginc.com