i have 10 atckdmg (AD) and he have 100HP and 4 DEF so im attacking him with my AD but he block 4 (becouse he have 4 DEF) of my AD so now i have 6 AD and i take 6 of his HP from his 100 HP
[how?] battle system
[how?] battle system
How to make simple battle system? For example:
i have 10 atckdmg (AD) and he have 100HP and 4 DEF so im attacking him with my AD but he block 4 (becouse he have 4 DEF) of my AD so now i have 6 AD and i take 6 of his HP from his 100 HP
. then his turn etc..
i have 10 atckdmg (AD) and he have 100HP and 4 DEF so im attacking him with my AD but he block 4 (becouse he have 4 DEF) of my AD so now i have 6 AD and i take 6 of his HP from his 100 HP
Re: [how?] battle system
You'll need to something similar to this:Nerfintas wrote:How to make simple battle system? For example:
i have 10 atckdmg (AD) and he have 100HP and 4 DEF so im attacking him with my AD but he block 4 (becouse he have 4 DEF) of my AD so now i have 6 AD and i take 6 of his HP from his 100 HP. then his turn etc..
$atkdam = "your users attack"
$defense = "Your users defense"
$newAtkdam = $atkdam - $defense; "which would equal 6"
To take from their hitpoints then you would need to just take their hitpoints and subtract the atkdamage... If their attack damage is 6 and your hitpoints are 100, then you'd end up with 94 hitpoints. And would write it like:
$newHP = $currenthp - $atkdam
Hope that helps. That was just a very basic description. If you need anymore just ask.
Re: [how?] battle system
ohhh its easy....
thank u bro ;D
Re: [how?] battle system
What we are here for! If you don't understand, don't be embarrassed, just ask! This is a great place to learn and everyone is friendly and understanding.Nerfintas wrote:ohhh its easy....thank u bro ;D
Re: [how?] battle system
i know i knowEpiales wrote:What we are here for! If you don't understand, don't be embarrassed, just ask! This is a great place to learn and everyone is friendly and understanding.Nerfintas wrote:ohhh its easy....thank u bro ;D