[how?] battle system

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
User avatar
Nerfintas
Posts: 54
Joined: Wed Aug 28, 2013 6:01 pm

[how?] battle system

Post 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..
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Re: [how?] battle system

Post 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. :)
Nothing fancy, but a work in progress!

http://gameplaytoday.net
User avatar
Nerfintas
Posts: 54
Joined: Wed Aug 28, 2013 6:01 pm

Re: [how?] battle system

Post by Nerfintas »

ohhh its easy.... :oops: thank u bro ;D
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Re: [how?] battle system

Post 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. ;)
Nothing fancy, but a work in progress!

http://gameplaytoday.net
User avatar
Nerfintas
Posts: 54
Joined: Wed Aug 28, 2013 6:01 pm

Re: [how?] battle system

Post 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 :)
Post Reply

Return to “Beginner Help and Support”