Hi All,
If I create an animation on Scratch then submit it to the Scratch website I find that all my animation timings are out and my project becomes jerky and/or disjointed.
Also, if I have an sprite which stops at the edge of the screen and is told to vanish (using 'if time...' rather than 'if touoching edge...') the sprite vanishes far from the edge of the screen when viewed on the site.
Any help is greatly appriciated,
G_O.
Offline
The java scheduler has some trouble with forever loops that don't contain waits.
I think there are some other problems with the java timing, but I have not yet come up with a small, simple program that triggers the problem.
Offline
The java implementation is definitely slower than running within Scratch. I solved the problem by doing a simple speed calibration when the project starts. Basically, it performs a task (looping some number of times and moving a hidden sprite). I time how long that takes and then adjust the number of steps each sprite takes based on the time it took divided by the time I expected it to take.
There's an example here: http://scratch.mit.edu/projects/weissjd/5435
One other thing to consider is that if you're going to use time to control movement you should always use time. If you start using time in some places and in others you have loops that aren't based on time and move a sprite x steps each time through the loop you're bound to run into problems between Scratch and java and possibly among different computers as well. So you're probably better off checking for 'toucing edge' or just the x,y position rather than time.
As for the jumpiness in java, I'm not sure if there's anything you can do about that. Maybe Kevin's suggestion to put short waits in your forever loops would help.
Offline