Hey first off I just want to say i am a complete noob at allegro and pretty much just started. What I want to do is keep a line on the screen for a second, but then have it disappear. Right now all that is happening is the line is just staying on the screen.
Here is my code:
#include <allegro.h>
#include <cstdlib>
BITMAP *buffer;
int main(){
allegro_init();
install_mouse();
install_keyboard();
set_color_depth(16);
set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0);
buffer = create_bitmap( 640, 480);
while( !key[KEY_ESC]){
if (key[KEY_SPACE]){
line( buffer, 30, 450, mouse_x, mouse_y, makecol( 255, 0, 0));
}
draw_sprite( screen, buffer, 0, 0);
release_screen();
rest(10);
}
return 0;
}
END_OF_MAIN();