How does {code...} PHP implement this PK process.
In the game, you hit me. I hit you, and both sides completed the following round. Now it is like this. On the left side is the attacker. First hit the character A on the left, character B, and character C ------------ on the right side. The APK process is the character A ----> attack: enemy A ----> Attack: character A (now the attack is complete, but the attack is not complete on the left) character B ----> attack: character C of enemy A ----> Attack: enemy A =============here, after A round of attacks is completed, enter the next round of PK ===== character forehand (that is, left) character A ----> attack: enemy A ----> attack: character A (now the attack is complete, but the attack is not complete on the left) character B ----> Attack: enemy A character C ----> attack: enemy ..... for example, the characters on both sides are composed of arrays. // Character $ humen = array (1 => array ('name' => 'character a' is _ attack' => 0, // indicates whether the current round has been attacked, reset it in the next round), 2 => array ('name' => 'character B ', 'is _ attack' => 0 ,), 3 => array ('name' => 'character C', 'is _ attack' => 0 ,)); // enemy $ enemy = array (1 => array ('name' => 'enemy A', 'is _ attack' => 0 ,),); finally, form such a process
Array (launch => 'left', attackor => 1, // character A initiates an attack hurt => array (0 => array ('beattackors '=> 1 ), // array indexes of the locations where beattackors is attacked by enemy A), 1 => array (launch => 'right', attackor => 1, // attacked by enemy A hurt => array (0 => array ('beattackers' => 1), // array indexes of the places where character A is attacked by beattackors )), 2 => array (launch => 'left', attackor => 2, // attacked by character B hurt => array (0 => array ('beattackors '=> 1), // array indexes of the places where enemy A is attacked by beattackors )), // because the attack has been completed by the enemy, but the attack has not been completed, continue left 3 => array (launch => 'left', attackor => 3, // attacked by character C hurt => array (0 => array ('beattackors '=> 1), // attacked array indexes corresponding to A beattackors )));
How does PHP implement this PK process.
Reply content:
In the game, you hit me. I hit you, and both sides completed the following round. Now it is like this. On the left side is the attacker. First hit the character A on the left, character B, and character C ------------ on the right side. The APK process is the character A ----> attack: enemy A ----> Attack: character A (now the attack is complete, but the attack is not complete on the left) character B ----> attack: character C of enemy A ----> Attack: enemy A =============here, after A round of attacks is completed, enter the next round of PK ===== character forehand (that is, left) character A ----> attack: enemy A ----> attack: character A (now the attack is complete, but the attack is not complete on the left) character B ----> Attack: enemy A character C ----> attack: enemy ..... for example, the characters on both sides are composed of arrays. // Character $ humen = array (1 => array ('name' => 'character a' is _ attack' => 0, // indicates whether the current round has been attacked, reset it in the next round), 2 => array ('name' => 'character B ', 'is _ attack' => 0 ,), 3 => array ('name' => 'character C', 'is _ attack' => 0 ,)); // enemy $ enemy = array (1 => array ('name' => 'enemy A', 'is _ attack' => 0 ,),); finally, form such a process
Array (launch => 'left', attackor => 1, // character A initiates an attack hurt => array (0 => array ('beattackors '=> 1 ), // array indexes of the locations where beattackors is attacked by enemy A), 1 => array (launch => 'right', attackor => 1, // attacked by enemy A hurt => array (0 => array ('beattackers' => 1), // array indexes of the places where character A is attacked by beattackors )), 2 => array (launch => 'left', attackor => 2, // attacked by character B hurt => array (0 => array ('beattackors '=> 1), // array indexes of the places where enemy A is attacked by beattackors )), // because the attack has been completed by the enemy, but the attack has not been completed, continue left 3 => array (launch => 'left', attackor => 3, // attacked by character C hurt => array (0 => array ('beattackors '=> 1), // attacked array indexes corresponding to A beattackors )));
How does PHP implement this PK process.
An attack order queue is arranged according to the speed attribute. The attack is complete and the attack goes out of the queue.
$ Add the Count attribute to humen, record who has attacked, and add the blood bar Value Attribute and is_alive attribute to the characters in each item. If there is no is_alive, set it to false;