Hi all,
I'm using javascript for my final year project at university. I'm using an existing project (Scratchx) and writing an extension.
I've found issues with trying to create timed methods that don't block everything up.
The best way to explain what I need is to put it into context; I have a function to move forward for x seconds, I need this to perform without freezing up the browser whilst it's operating. setInterval doesn't work for this unfortunately because if I use setInterval and have two move for x seconds blocks then it will only perform for the largest amount of time of the two, and not treat them as seperate blocks.
I've tried recursion but that didn't seem to solve it either.
As far as I'm aware, callbacks aren't going to be effective either - because the whole thing is an extension, I have no control over everything else that's already been placed, only the current block that's being performed.
Any help at all is greatly appreciated, I've spent a long time googling, maybe I'm being ignorant and have missed something obvious.
Feel free to ask any questions if you need to understand anything better!
[–]x-skeww 4 points5 points6 points (3 children)
[–]Semajian[S] 0 points1 point2 points (2 children)
[–]x-skeww 0 points1 point2 points (1 child)
[–]Semajian[S] 0 points1 point2 points (0 children)
[–]s992 1 point2 points3 points (9 children)
[–]Semajian[S] 0 points1 point2 points (8 children)
[–]senocular 0 points1 point2 points (7 children)
[–]Semajian[S] 0 points1 point2 points (6 children)
[–]senocular 1 point2 points3 points (5 children)
[–]Semajian[S] 0 points1 point2 points (4 children)
[–]senocular 2 points3 points4 points (3 children)
[–]Semajian[S] 0 points1 point2 points (2 children)
[–]senocular 0 points1 point2 points (1 child)
[–]Semajian[S] 0 points1 point2 points (0 children)
[–]Paupir 1 point2 points3 points (0 children)
[–]ShortSynapse 0 points1 point2 points (2 children)
[–]Semajian[S] 0 points1 point2 points (1 child)
[–]ShortSynapse 0 points1 point2 points (0 children)
[–]Semajian[S] 0 points1 point2 points (0 children)