Forum Moderators: coopster
BUT_ here's the thing:
When it's your turn to attack, and all that you need is to pick a target ( an [a href]), you can hammer the link (or click it a bunch of times) and get many strikes out of a single turn!
The 'action' handler is a seperate .php, and the first thing it does is take the active character and move him down the list.
How can I stop this?!
I thought about switching the method to a form, but I remember seeing paysites that suggest that I click the submit button ONLY ONCE! Would this still happen with forms as well?
Should I bounce to an additional script?
hmmm might work, or would it?
(Selection.php --->
Location: KickYouAsActive.php?active=you --->
Location: Action.php --->
[back to]Location: Selection.php)
///////
Then you would have
onmousedown="document.performedAction=true"
in your links and this would get sent to the next script so you could have
if(performedAction){//ignore}
else{ perform action}
Then do:
disableLink(aEl) {
text = aEl.innerHTML;
parentEl = aEl.parentNode;
parentEl.removeChild(aEl);
parentEl.appendChild(document.createTextNode(text));
}
This will effectively disable the link after one click. Of course, the example is crude and not thouroughly tested, but it should provide the concept.
eg. Only one open move at a time, and I guess they have to wait for a turn/tick.
if it's turn-based, it's very simple..
first you arrange who is first, second and third.
first clicks:
update table, set can_move = 0
update table, set can_move = 1 where player = second
ps.. this is psuedocode!