Page 1 of 1

[how?] battle system

Posted: Wed Sep 25, 2013 5:04 pm
by Nerfintas
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 :D. then his turn etc..

Re: [how?] battle system

Posted: Wed Sep 25, 2013 10:10 pm
by Epiales
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 :D. then his turn etc..
You'll need to something similar to this:

$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

Posted: Thu Sep 26, 2013 5:08 am
by Nerfintas
ohhh its easy.... :oops: thank u bro ;D

Re: [how?] battle system

Posted: Thu Sep 26, 2013 5:10 am
by Epiales
Nerfintas wrote:ohhh its easy.... :oops: thank u bro ;D
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. ;)

Re: [how?] battle system

Posted: Thu Sep 26, 2013 5:15 am
by Nerfintas
Epiales wrote:
Nerfintas wrote:ohhh its easy.... :oops: thank u bro ;D
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. ;)
i know i know :)