2015-03-06 14:06:34

hey there!
;please tell me where the error in the code? ;something with the algorithm.
#include "dynamic_menu.bgt"
#include "sound_pool.bgt"

int player_hp = 100;
int level = 1;
int pposition = 5;
int player_position = 1;
int rezult = 0;
const int board = 50;
timer steper;
sound_pool rus;
sound_pool pool;
sound wepo;
sound_pool wep;
sound zvan;
sound zvan_ser;
sound zvan_no;
sound zvan_star_ser;
sound v1;
sound v2;
sound v3;
sound v4;
sound v5;
sound v6;
sound v7;
sound v8;
sound v9;
sound v10;
sound v11;
sound step;
sound start;
sound fon;
sound music;
sound german;
void main()
{
fon.stop();
zvan.load("Sounds\\zvan.wav");
zvan_ser.load("Sounds\\zvan_ser.wav");
zvan_no.load("Sounds\\zvan_no.wav");
zvan_star_ser.load("Sounds\\zvan_star_ser.wav");
v1.load("Sounds\\v1.wav");
v1.pan = (-30);
v2.load("Sounds\\v2.wav");
v2.pan = (30);
v3.load("Sounds\\v3.wav");
v3.pan = (-30);
v4.load("Sounds\\v4.wav");
v4.pan = (30);
v5.load("Sounds\\v5.wav");
v5.pan = (-30);
v6.load("Sounds\\v6.wav");
v7.load("Sounds\\v7.wav");
v7.pan = (-30);
v8.load("Sounds\\v8.wav");
v9.load("Sounds\\v9.wav");
v9.pan = (30);
v10.load("Sounds\\v10.wav");
v11.load("Sounds\\v11.wav");
v11.pan = (30);
wepo.load("Sounds\\vin.wav");
fon.load("Sounds\\fon.wav");
fon.volume = -10;
step.load("Sounds\\step.wav");
step.volume = 50;
dynamic_menu my_menu;
int menu_result;
show_game_window("Call Of Duty: Blinde");
my_menu.add_item_tts("Start game.");
my_menu.add_item_tts("Exit.");
menu_result=my_menu.run("choose an option.", true);
if(menu_result==-1)
{
alert("Error", "There was an error loading the menu.");
exit();
}
if(menu_result==0)
{
exit();
}
if(menu_result==1)
{
game_play();
}
if(menu_result==2)
{
exit();
}
}

class enemy
{
int hp;
int position;
timer time;
timer enemyy;
int speed;
int ammo = 1000;
enemy()
{
hp = 10;
position = 50;
speed = 300;
}
void move() {
if(time.elapsed>=speed) {
if(position>player_position) position--;
if(position<player_position)
{
position++;
pool.play_1d("sounds/step.wav", player_position, position, false);
}
time.restart();
time.resume();
}
if(absolute(player_position-this.position)<=10 and this.ammo>0) {
if(enemyy.elapsed>1000)
{
wep.play_1d("Sounds/vin.wav", player_position, position, false);
this.ammo--;
player_hp-=10;
enemyy.restart();
}
}
}
}

void game_play()
{
start.load("Sounds\\start.wav");
start.play_wait();
v1.play_wait();
v2.play_wait();
v3.play_wait();
v4.play_wait();
v5.play_wait();
v6.play_wait();
v7.play_wait();
v8.play_wait();
v9.play_wait();
v10.play_wait();
v11.play_wait();
fon.play_looped();
while(true)
{
if(steper.elapsed>=300)
{
if(key_down(KEY_LEFT))
{
player_position--;
step.play();
}
if(key_down(KEY_RIGHT))
{
player_position++;
step.play();
}
steper.restart();
}
if(player_position<=0)
{
step.stop();
player_position++;
}
if(player_position>board)
{
step.stop();
player_position--;
}
if((player_position>=10)and(not german.playing)and(level==1))
{
int g_rand = random(1, 8);
german.load("Sounds\\german_propaganda"+g_rand+".wav");
german.play();
}
if(key_pressed(KEY_X))
{
exit();
}
if(player_position==50)
{
l2();
}
}
}

void l2()
{
german.stop();
level = 2;
player_position = 1;
rus.play_1d("Sounds/new.wav", player_position, pposition, false);
while(true)
{
if(steper.elapsed>=300)
{
if(key_down(KEY_LEFT))
{
player_position--;
step.play();
}
if(key_down(KEY_RIGHT))
{
player_position++;
step.play();
}
steper.restart();
}
if((key_pressed(KEY_SPACE))and(player_position==5))
{
wepo.play();
rezult = 100;
}
if((key_pressed(KEY_SPACE))and(player_position==4)or(player_position==6))
{
wepo.play();
rezult = 50;
}
if(key_pressed(KEY_SPACE))
{
wepo.play();
rezult = 10;
}
if((rezult==100)or(rezult==50)or(rezult==10))
{
zvan.play_wait();
}
if(rezult==100)
{
zvan_star_ser.play_wait();
main();
}
if(rezult==50)
{
zvan_ser.play_wait();
main();
}
if(rezult==10)
{
zvan_no.play_wait();
main();
}
}
}

2015-03-06 14:14:50

Please, give more detailed information about this error. Is it a compiling error? In that case, what is the error message?
If not, tell us more about what is going wrong with your code smile

2015-03-06 14:33:26

No error algorithm.
;I have a polygon, which is training.
;I need to get to the center of the general, that is, that he was in the middle, and shoot.
;A skill run 2 sounds simultaneously, 1 right, 1 no. ;error as I understand it in l2
I apologize for my English, Yu translate translator, Russian forums and acquaintances on the theme bgt no, you all hope.

2015-03-06 22:45:27

please please please! help!

2015-03-06 23:08:15

I have a friend who may help me reading russian, maybe you could ask me your problems in your mother language in PM?

2015-03-07 00:09:49

He's using Google Translate. A really old version of it by the way his text is written. I can hardly interpret what his posts mean, but that's my natural language processor for other language translations. (Its my brain.) In order for me to help him fully, i need him to learn the English language.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2015-03-07 00:25:52

Or to get a russian-english human translator smile

2015-03-07 09:25:40

Ребята! Спасибо кто хотел помочь! Я нашел где была ошибка. Она была в том месте, где я проходил, не обращая внимание
if((key_pressed(KEY_SPACE))and(player_position==4)or(player_position==6))

2015-03-07 20:09:08

No problem smile