Forum Moderators: open
I have no experience with javascript, or ajax. I am a PHP coder, and am designing a game of sorts.
The best way to explain it is as follows. A user has a hand of cards, their opponent does too. For each card in the hand, I want to be able to click it, highlight it, then click an enemy card (which will also be highlighted.
I want to be able to do this for each card in my hand, so the corresponding enemy card is highlighted in the same color...
Then I want to be able to click attack, and the attack/defend pairs be inserted into a mysql database.
I can do the updating part, but I cant do the selecting part.
Also Im not sure of a resolution for when two user cards attack the same enemy card.
Any help would be greatly appreciated.
T
Not that this answer will help (at all), but -- have you considered a more robust solution? Perhaps using Flash or something would be better? If you do decide to move forward with JavaScript, you need to make sure that all verifications are done on the server. You mention a possible conflict if multiple players attack the same card. Things like that should be verified on the server. Once you have that server piece done (in PHP, I assume) you can easily use JavaScript/AJAX or Flash or anything else, whichever you are more comfortable with.