Jump to content

Recommended Posts

I have a game that uses links to move about an area.  After moving a random number determines if a creature attacks the player.  Apparently if the movement links are clicked rapidly, players can avoid being attacked alltogether.

 

Is there a way to prevent this?  If you want the code, I'll give it, but it is rather long.

Link to comment
https://forums.phpfreaks.com/topic/128371-rapid-clicks/
Share on other sites

It's caused because you're doing the check to see if a creature attacks after the player has a chance to move. If they continually click the move links, the page doesn't have enough time to load the creature encounter. You can have the movement links go through a different page, checking for a creature attack, and then redirecting to the movement page instead, then it wouldn't matter how fast they click it.

Link to comment
https://forums.phpfreaks.com/topic/128371-rapid-clicks/#findComment-664994
Share on other sites

It's caused because you're doing the check to see if a creature attacks after the player has a chance to move. If they continually click the move links, the page doesn't have enough time to load the creature encounter. You can have the movement links go through a different page, checking for a creature attack, and then redirecting to the movement page instead, then it wouldn't matter how fast they click it.

 

Thanks.  I'll try that.

Link to comment
https://forums.phpfreaks.com/topic/128371-rapid-clicks/#findComment-665009
Share on other sites

You can use some javascript and when a link is clicked make it disappear until the page is loaded again.  Or if you are using buttons you can disable them.  Then they couldn't click on it again until the page is reloaded.

 

This would work, but when working with people who have fun exploiting your games, they can and will disable javascript or bypass it completely with their own javascript scripts.

Link to comment
https://forums.phpfreaks.com/topic/128371-rapid-clicks/#findComment-665071
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.