Ok this is where the error happens.
After all lives are lost and the screen is cleared and you are showen you last score as shown here
textprintf_ex(screen,font,0,10,makecol(255,255,255),-1,"Last Score was %i Press ESC to Exit",score);
while(!key[KEY_ESC]); //<---Something after here causes the error.
Right when you press Escape to exit out completely this is where the error occurs.
and when I commented out everything that destroys it worked fine. So I decided to comment one out at a time and found thatunload_datafile(data);was the problem.
To further answer your question on how everything is placed. I started this program in QBASIC almost 8 years ago when I was 14. 3 years ago (about) I wanted to learn C/C++ and decided what a good way to learn by taking my favorite project from QBASIC and translating it to C/C++. About 2 years ago I set the project down and that was also the time I started using this forum. Then about a week ago I sat down looked at my code and was dumbfounded, didn't know what was going on so I just decided to start messing around with all the values and doing what I remembered and very quickly remembered just about everything.
Long story made short. It was how everything was done in QBASIC except in QBASIC I could use SUB's to make the program seem less cluttered. I know somethings dealing with my loops could be made considerably smaller, but I never really got into C/C++ because of the lack of graphic manipulation with out a library. And books on C/C++ never talked about those libraries. So instead of learning all of C/C++ I just learned how to put everything together and just get started in Allegro.
Not one that can read and learn. It must be hands on. And I got tired of talking about Printf and cout for 30 pages.;D
I thought that is what I was doing here. Although I dont see the need to have it in the code since the functions usually never are passing a value.