How to calculate winner in a fight on browser based game ?

Discussion in 'PHP' started by morency, Mar 15, 2012.

  1. #1
    Hy !

    I work on a Browser Based Game and I need a tip from someone who previously worked on this kind of sites .
    How can be "calculated" the fight between two characters ? do you use any formula ?!

    I have this atributes :


    Strength
    Defence
    Agility
    Stamina
    Dexterity
    Total experience
    Health

    Strength and Agility is used for attack
    Defence and Dexterity is used to block attack
    Stamina is used to give more hits ( decreases after each hit)
    Health decreases after each hit .



    any suggestion ?!

    thank you
     
    morency, Mar 15, 2012 IP
  2. GMF

    GMF Well-Known Member

    Messages:
    855
    Likes Received:
    113
    Best Answers:
    19
    Trophy Points:
    145
    #2
    Mhhh.. The thing that comes to mind would be to look at some of the table-top RPGs like D&D, Pathfinder, Warhammer etc...

    Browser based... So you can use some random number generators (almost every programming language has to offer some). You could roll a virtual dice that takes the character attributes into account.. As I said, loot at the table top games...
     
    GMF, Mar 15, 2012 IP