Re: Error in BGT
Main file:
sound_pool s;
int x=1;
int hp;
timer step;
enemy@[] enemies(0);
void main()
{
show_game_window("Warrior Adventure");
set_sound_decryption_key("ILoveKids", true);
set_sound_storage("sounds.dat");
install_keyhook();
wait(1000);
dlgplay("logo.wav");
wait(500);
mainmenu();
}
void l1()
{
dlgplay("l1.wav");
s.play_stationary("ambiant1.wav", true);
hp=100;
for(int i=0; i<5; i++)
{
enemy enemy1();
enemies.insert_at(i, enemy1);
enemies(i).speak();
}
while(true)
{
for(int i=0; i<5; i++)
{
enemies(i).move();
enemies(i).fire();
enemies(i).die();
enemies(i).update();
}
if(key_down(KEY_LEFT) and step.elapsed>300 and x>1)
{
x-=1;
s.play_stationary("step1_"+random(1, 3)+".ogg", false);
step.re
start();
}
if(key_down(KEY_RIGHT) and step.elapsed>300 and x<150)
{
x+=1;
s.play_stationary("step1_"+random(1, 3)+".ogg", false);
step.restart();
}
if(key_pressed(KEY_ESCAPE))
{
s.destroy_all();
for(int i=0; i<5; i++)
{
enemies(i).e.destroy_all();
enemies.remove_at(i);
}
mainmenu();
}
if(key_pressed(KEY_C))
{
speak(x);
}
if(key_pressed(KEY_H))
{
speak(hp);
}
if(hp<=0)
{
for(int i=0; i<5; i++)
enemies.remove_at(i);
s.destroy_all();
dlgplay("k"+random(1,4)+".wav");
mainmenu();
}
if(key_pressed(KEY_SPACE))
{
s.play_stationary("pistol.wav", false);
for(int i=0; i<5; i++)
{
if(absolute(x-enemies(i).position)<=5)
{
s.play_1d("pain"+random(1,15)+".wav", x, enemies(i).position, false);
enemies(i
).health-=random(15,30);
}
}
}
s.update_listener_1d(x);
wait(5);
}
}
void test()
{
dlgplay("test.wav");
}
_______________________________________________ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector