How does one php handle the PK process of the retrieval system?

Source: Internet
Author: User
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;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.