Exactly, the first player that calls battle_engine.php will cause the upload of the battle info and results, and the second player will just read it from the database.
Well thats kind of how i've set it up, it's pretty good, but there still the problem i mentioned which actually i think a solution. Battle_engine.php is run for both players so it's called twice, and if battle_engine.php calculates damage for both pokemons and its done twice, that means the pokemons...
Here's a problem. As battle_engine.php is called twice(one for each client) on server-side the pokemons attack twice. How can i prevent this from happening?
Currently it first checks the actions so if both players choose to attack then the faster(highest speed stat) pokemon goes first and when if one choose to change the pokemon or used an item it'll always goes first despite the speed. Thank you very much for answering, here is another question for yo...
Currently it first checks the actions so if both players choose to attack then the faster(highest speed stat) pokemon goes first and when if one choose to change the pokemon or used an item it'll always goes first despite the speed. Thank you very much for answering, here is another question for you...
Yep, thats actually what i think is the best. Do all the battle server-side and then show(animate the attacks, get hit and be wounded) the results client-side. What might be a problem is deciding who goes first, i guess that would be calculated in battle_engine.php and then just return to the client...