Hey all, I'm working on a nibbles-type game and I'm trying to add a high score table, but when I try to declare a ifstream I get weird errors. Any ideas? (source/screenshot of error attached)
Hey all, I'm working on a nibbles-type game and I'm trying to add a high score table, but when I try to declare a ifstream I get weird errors. Any ideas? (source/screenshot of error attached)
Illusion and reality become impartiality and confidence.
I think it means you're not using it, but that shoulnd't stop the
linking proces.
--
For one thing, you're supposed to make it #include<allegro.h>, but I'm not sure if that will solve your problem or not. A couple more things that will help you out but that do not relate to your problem.
Do this
blit(buffer,screen,0,0,0,0, SCREEN_W, SCREEN_H); instead of blit(buffer,screen,0,0,0,0,640,480);
In case you want to go back and change the resolution for the game you won't have to go back to every time you do 640, 480...so always do SCREEN_W, SCREEN_H, except when you initialize the graphics mode. Which brings me to my next point. You might as well init your graphics mode like this...
set_gfx_mode(GFX_AUTODETECT_FULLSCREEN,640,480,640 ,480);
Remember that the last two 640, 480 are for the virtual screen, so if you're not using any sort of virtual then you should set those to 0, 0 instead of 640, 480.
Never use rest(). When you're declaring rest(50) it will process at different speeds on different computers. Instead use a timer that will pause the game for 50 milliseconds.
Sorry, I may not have solved your problem, but the pieces of info I did tell you should help you out still.Code://setting up a timer volatile int counter; void update_counter() { counter++; } //initialize the timer install_timer(); install_int_ex( update_counter, BPS_TO_TIMER(60)); //using in place of rest(50) counter = 0; while(counter < 3); /*this will pause the game for 1/20th of a second which should be the equivalent of 50 milliseconds*/