Jump to content

[SOLVED] PHP Order


Minase

Recommended Posts

hi again,now im working on my battle script for my game but i don't know how to do this task,know it should be easy but don't have nothing in mind right now what i should google.thanks.

 

$attacker = "Attacker";
$defender = "Defender";

$rounds = rand(5,10);
for($r = 1; $r <= $rounds ; $r++){
//the php part needed

}

 

$rounds = it define how many rounds users can fight

i want first attack to be gived by attacker,and the second by defender,and so on till the rounds end

if $rounds = 5

$attacker->Attack;
$defender->Attack;
$attacker->Attack;
$defender->Attack
$attacker->Attack;

 

dont know really how to define it.thank you.

Link to comment
https://forums.phpfreaks.com/topic/120222-solved-php-order/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.