gamesmstr Posted October 14, 2008 Share Posted October 14, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/128371-rapid-clicks/ Share on other sites More sharing options...
Lamez Posted October 14, 2008 Share Posted October 14, 2008 Well we can only determined what is wrong, only by seeing the code. Unless a Guru come along, or an Expert. Quote Link to comment https://forums.phpfreaks.com/topic/128371-rapid-clicks/#findComment-664992 Share on other sites More sharing options...
Zhadus Posted October 14, 2008 Share Posted October 14, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/128371-rapid-clicks/#findComment-664994 Share on other sites More sharing options...
Lamez Posted October 14, 2008 Share Posted October 14, 2008 Like I said, unless an Guru or an Expert came along. Quote Link to comment https://forums.phpfreaks.com/topic/128371-rapid-clicks/#findComment-664997 Share on other sites More sharing options...
gamesmstr Posted October 14, 2008 Author Share Posted October 14, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/128371-rapid-clicks/#findComment-665009 Share on other sites More sharing options...
CroNiX Posted October 14, 2008 Share Posted October 14, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/128371-rapid-clicks/#findComment-665047 Share on other sites More sharing options...
Zhadus Posted October 14, 2008 Share Posted October 14, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/128371-rapid-clicks/#findComment-665071 Share on other sites More sharing options...
CroNiX Posted October 14, 2008 Share Posted October 14, 2008 Yes, for less than 1% of people maybe, but the majority wouldn't even know to do it. There is no perfect solution for this dilemma. Quote Link to comment https://forums.phpfreaks.com/topic/128371-rapid-clicks/#findComment-665091 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.