[solved] "action in progress" and stuttering animations
Posted: 30 July 2015, 11:17
I'm working on a Fanorona adaptation.
When I move a stone successively while waiting about one long, long second between each move, it works well. However, if I click multiple times on the target intersection, it apparently executes an action which will never end. If I then click to move my stone multiple times, the game tells me that an action is already in progress even if I wait seconds before each move.
And if I click on a new available intersection immediately after a move, it generates other errors.
/!\ All these errors disappear if I remove this line from my .js :
I still check for the state server side on my .game.php.
Any idea where does this issue come from ?
Is it useful to keep this checkaction in my .js even if we have a lock: true in the following ajax call and a server side check action ?
I also have another issue. The moves are very slow : about 200ms between the click and the beginning of the animation (when the move is recorded I guess). That could come from my internet connection as I live in the far campaign (unstable 200 KBs), but how can I be sure ?
Plus, the animation itself of the sliding stone is stuttering. It should be smooth… Any idea about that ? I thought it could be because of other CSS animations happening at the same time like the scrolling log elements, but I hid them and the animation was still stuttering even if it was the only animation on the screen.
Here is my related .js function : http://pastebin.com/ynSN6uyH
my PHP action : http://pastebin.com/tCpq0pUX
my PHP action function : http://pastebin.com/5kcCCuPk
my used utility functions : http://pastebin.com/0uxSMG1c
Is there anything I do wrong that could cause these different issues ?
When I move a stone successively while waiting about one long, long second between each move, it works well. However, if I click multiple times on the target intersection, it apparently executes an action which will never end. If I then click to move my stone multiple times, the game tells me that an action is already in progress even if I wait seconds before each move.
And if I click on a new available intersection immediately after a move, it generates other errors.
/!\ All these errors disappear if I remove this line from my .js :
Code: Select all
if(!this.checkAction('moveStone')) { return false; }Any idea where does this issue come from ?
Is it useful to keep this checkaction in my .js even if we have a lock: true in the following ajax call and a server side check action ?
I also have another issue. The moves are very slow : about 200ms between the click and the beginning of the animation (when the move is recorded I guess). That could come from my internet connection as I live in the far campaign (unstable 200 KBs), but how can I be sure ?
Plus, the animation itself of the sliding stone is stuttering. It should be smooth… Any idea about that ? I thought it could be because of other CSS animations happening at the same time like the scrolling log elements, but I hid them and the animation was still stuttering even if it was the only animation on the screen.
Here is my related .js function : http://pastebin.com/ynSN6uyH
my PHP action : http://pastebin.com/tCpq0pUX
my PHP action function : http://pastebin.com/5kcCCuPk
my used utility functions : http://pastebin.com/0uxSMG1c
Is there anything I do wrong that could cause these different issues ?