hi
this code is to get a pic keep moving it's worked in BGI but without pictures now i tried it in allegro and it doesn't show a thing
can u see what i'm doing wrong or do u know a better way to get the pic move till next keypress?
Code:
#include <allegro.h>
#include <stdlib.h>
#include<conio_mingw.h>
int main()
{
char ror=30;
quit = 0;
allegro_init();
install_keyboard();
set_color_depth(32);
set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 640, 480, 0, 0);
BITMAP *p1 = load_bitmap( "c:\\temp\\pic1.bmp", NULL );
BITMAP *p2 = load_bitmap( "c:\\temp\\pic2.bmp", NULL );
while ( !quit )
{
while(kbhit())
{
ror==getch();
}
switch(ror)
{
case 'a':
ror-- ; draw_sprite( screen, p1, ror, 400 ); break;
case 'd':
ror++; draw_sprite( screen, p2, ror, 400 ); break;
case 'q': quit = 1; break;
}
}
destroy_bitmap(p1);
destroy_bitmap(p2);
allegro_exit();
return 0;
}
END_OF_MAIN();