Fighing system in Php & MYSQL
- by Gully
I am working on a game like Mafia Wars and i am trying to get the fighting system working but i keep getting lose trying to work out who is going to win the fight and it still needs to know if the stats are close then there is a random chace of them winning.
$strength = $my_strength;
$otherplayerinfo = mysql_query("SELECT * FROM accounts WHERE id='$player_id'");
$playerinfo = mysql_fetch_array($otherplayerinfo);
$players_strength = $playerinfo['stre'];
$players_speed = $playerinfo['speed'];
$players_def = $playerinfo['def'];
if($players_strength > $strength){
$strength_point_player = 1;
$strength_point_your = 0;
}else{
$strength_point_your = 1;
$strength_point_player = 0;
}
I was trying a point system but i still could not do it.