X + beside_people gt;=BX) amp; amp; (AY + beside_people lt;=BY)) _ shooting ( ); (bullet_move == «XLeft») (AX lt;=BX + beside_people) _shooting (); (bullet_move == «XRight») (AX + beside_people gt;=BX) _shooting (); (bullet_move == «YDown ») (AY gt;=BY + beside_people) _shooting (); (bullet_move ==« YUP ») (AY + beside_people lt;=BY) _shooting ();
//Вмще зазначену код відповідає Моделювання руху кулі_step +=1;
. Refresh ();
}
lt; int gt; list_people=new List lt; int gt; (); strongest_man; void random_real_people ()
{_ people. Clear (); strongest=- 1; _man=- 1; (int i=0; i lt; people. GetLength (0); i ++)
{(people [i, 0] == 1) _people. Add (i);
} random=new System. Random (); (int i=0; i lt; list_people. Count; i ++)
{j=random. Next (list_people. Count); temp=list_people [i]; list_people [i]=list_people [j]; list_people [j]=temp;
} (int i=0; i lt; list_people. Count; i ++) ((people [list_people [i], 5] gt; strongest) amp; amp; (list_people [i]!= list_people [0]))
{= people [list_people [i], 5]; _ man=list_people [i];
}
}
//Завершення пострілу куліvoid completion_shooting ()
{
//скріваєм кулю [A, 0]=0;
//статус людини (type_shot == «killed») [B, 0]=0; (type_shot == «live») [B, 0]=1;
(type_shot == «killed»). GridReport. Rows. Add (nameColor [list_people [0]] + «зніщів» + nameColor [strongest_man]); (type_shot == «live»). GridReport. Rows. Add (nameColor [list_people [0]] + «не потрапивши в» + nameColor [strongest_man]);
//зупинка Кулі. Enabled=false; _current_point (); lt; int gt; All_people=new List lt; int gt; (); (int i=0; i lt; people. GetLength (0); i ++) (people [i, 0] == 1) All_people. Add (i); (All_people. Count == 1)
{. Visible=true ;. GridReport. Rows. Add («Гра завершена, переможець - " »+ nameColor [list_people [0]] +« " ») ;. Text=«Гра завершена, переможець - " »+ nameColor [list_people [0]] +« " »;
}
}
void upgrade_current_point ()
{(int i=0; i lt; bullet. GetLength (0); i ++)
{[i, 0]=0; [i, 1]=people [i, 1] + (float) Math. Round ((float) (people [i, 3] - size_bullet)/2); [i, 2]=people [i, 2] + (float) Math. Round ((float) (people [i, 4] - size_bullet)/2); [i, 3]=size_bullet; [i, 4]=size_bullet;
}
. Refresh ();
}
private void upgrade_current_state ()
{
//Початкові параметріCountRowsDB=DlReport. GridReport. Rows. Count - 1; (CountRowsDB == 0). GridReport. Rows. Add («Нова гра розпочато»); (CountRowsDB gt; 0) (DlReport. GridReport. Rows [CountRowsDB - 1] .Cells [0] .Value. ToString ()!=«Нова гра розпочато»). GridReport. Rows. Add («Нова гра розпочато»);
. Visible=false ;. Text=«Інформація»;
[0, 0]=1; [0, 1]=75; [0, 2]=20; [0, 3]=50; [0, 4]=50; [0 , 5]=10;
[1, 0]=1; [1, 1]=300; [1, 2]=20; [1, 3]=50; [1, 4]=50; [1 , 5]=8;
[2, 0]=1; [2, 1]=90; [2, 2]=170; [2, 3]=50; [2, 4]=50; [2 , 5]=5;
[3, 0]=1; [3, 1]=290; [3, 2]=170; [3, 3]=50; [3, 4]=50; [3 , 5]=5;
[4, 0]=1; [4, 1]=190; [4, 2]=220; [4, 3]=50; [4, 4]=50; [4 , 5]=5;
//вищє реалізується занесення информации про дуелянтів до масіву_current_point ();
. Focus ();
}
random_shot=new Random ();
void btnNewGame_Click (object sender, EventArgs e)
{
//Качан новой грі_current_state ();
}
void btnShot_Click (object sender, EventArgs e)
{. Focus ();
_ real_people (); (list_people. Count == 1);
//номери людей=list_people [0];=strongest_man;
//визначення статусу дуелянта (Convert. ToInt32 (Math. Round (people [list_people [0], 5])) gt;=random_shot. Next (1, 11)) _ shot=«killed» ; _shot=«live»;
//додаємо лічільнік_step=0;
//створюємо розгалуження (type_shot == «killed») _ people=0; (type_shot == «live») _ people=40;
//візначаємо ст...