Jump to content
MakeWebGames

Recommended Posts

Posted

I've tried but can't comeup with a good formula for a Hit/Miss.

Here are the 2 vars, can anyone help me come up with a good Hit/Miss formula.

$Player1Hit = 300;

$Player2Dodge = 250;

Posted (edited)

OK hoping someone can help me out here abit, the below code is just abit of the formula i am making for hit/miss but getting a problem.

The output of the below code is 14.2857142857 but i want it just as 14,so how can that be achieved?

$MYACCURACY = 1000;

$HISDODGE = 700;

$Divide = $MYACCURACY/$HISDODGE; $Multiply = $Divide*100/10;

if($Multiply < 1) {$Multiply = 1;} else{abs(intval(round($Multiply)));}

echo"{$Multiply}";

Thanks :)

Edited by SHAD
code tags didn't work for me :(

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...