Mail Archives: djgpp/1998/11/02/05:44:05
could you look at this code for me please..
//----------------------------------------
//-------------------------------
//thank you for looking at this..
// #1, no sound, but it should work
// #2, why do i need 2 of the }, at the end.
// #3, is the KEY_UP, right
// --- there all close to the bottom
// --- thank's again
//-----------------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <allegro.h>
//--------------------------------------------------
char buf[80];
//--------------------------------------------
int main (char *argv[]) {
SAMPLE *shoot ;
allegro_init();
install_keyboard();
//------------------
//-----------------------------------
install_mouse();
install_timer();
set_gfx_mode(GFX_VGA, 320, 200, 100,0);
set_pallete(desktop_pallete);
//------------------------
//-------------------------------
//--------------------------------
//------------------------
fade_in (desktop_pallete,1);
//---------------------------
//---------------------------
putpixel (screen, 7,20,7);
vline(screen,80,25,50,1);
// fade_out (1);
vline(screen,100,25,50,6);
show_mouse (screen);
//-----------------------------
load_wav("shoot.wav");
//------------------------------
//------------ #1 how come i get no sound
// --- #2 and KEY_UP, is it right
while (!keypressed(KEY_UP));
//-------------------------------
if(install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, argv[0]) != 0) {
play_sample(shoot, 62, 192, 1000, 1);
while (KEY_UP);
//-------------------------------
play_sample(shoot, 62, 192, 1000, 1);
//-------------------------------
return 0;
//---------------------------------
} //--#3 why do i need 2 of these ..
}
- Raw text -