Pages: 1
Topic closed
Hi,
I just uploaded two projects and neither one of them worked the same way they did on my computer.
i'm not surprised the first project ('cat-n-mouse') didn't work because it's my first one, but still, it does work fine on my computer, so why not here?
the second project works beautifully on my computer. the light cycles leave walls and bang into them properly, and then the game refreshes the level and erases all the light-walls.
however, when i upload it. the light-cycles die when you try to make a turn, as if they are not rotating the same way they did offline.
also, the pen doesn't lift up properly for the blue player, so when i reset the position of the cycles, the blue cycle draws a line which doesn't erase.
so first, i need help debugging the light-cycle game.
and second, i need to understand what's going on here. why are there differences between uploaded projects and my local projects?
Offline
I don't have time to hepl with debugging right now, but there have been several threads on differences between the Java and Squeak implementations.
Scratch Team, maybe it's time to open an new Forum at the top level:
Web-site/standalone differences
and move all the threads on that topic into the forum?
Last edited by kevin_karplus (2007-06-14 15:27:01)
Offline
isn't scratch supposed to be easy for kids?
debugging errors between java and squeak doesn't seem like "easy".
is there a real solution in the works? or should i just tell the kids (don't bother to upload)?
is there a way to export stand-alone versions of these games/videos rather than post them here?
Offline
The squeak/java differences are bugs, and I'm sure the scratch team is working diligently on trying to fix them (at least the part of the scratch team responsible for the applets). There is some time delay in debugging any chunk of code, and they may have released the the java applets a little too soon, but it is pretty close and may have needed the stress testing of having hundres of programmers bashing on it to find the remaining problems.
Some of the differences are not due to bugs in the java or squeak implementations, but bugs in the multi-threaded scratch programs that were hidden by things working coincidentally on one implementation. (Race conditions, for example, that depend on one script finishing before another may work on one machine but not not another.)
It is possible to set up your own website to post programs to---there are several threads on that topic as well as useful advice on one of the scratch documentation pages. Currently there is no way to export scratch programs as videos or flash animations. I suspect that when the scratch team finally releases documentaion on the .sb format, someone will start writing a scratch->flash translator.
Offline
The problem with your light racer game is a common one---you have a forever loop with no waits in it. Either change one or more of the broadcasts to broadcast-and-wait or add an explicit wait to the loop. The scheduler for the java implementation runs forever loops pretty tightly, and may starve the other threads. Putting explicit waits in the loop allows the scheduler to let the other threads run. I understand that the scratch team is working on putting in a fix for this (probably making all loops have an built-in rescheduling break once per iteration).
Offline
Hi, Pugimelon.
I just fixed a bug in the Java player that may have been causing the problem in your cat-n-mouse game. (The new Java player says "v13" in the upper left corner; you might need to quit and restart your browser to get this new version.)
You can fix the light racer game by setting the "rotation style" of both sprites so that the costume does not rotate when the heading changes (the bottom button above the "scripts" tab). What was happening was that the rotation was causing the racer to see it's own trail, stopping the game. I think it only happened to the left racer because Java's image rotation shifted the costume one pixel to the left; that did not matter for the left-traveling racer. Turning off rotations prevents these rotation-relatated roundoff errors from messing you up--and for a one-pixel costume rotation doesn't matter!
I'm sorry you hit problems with your first two projects. Your projects use sophisticated code, with interacting sprites and lots of broadcasts. They push the limits in ways that simpler projects do not.
The Java player is much newer than Scratch. It will gradually get more robust. As Kevin says, the more subtle bugs take a while to emerge--and sometimes they take a while to track down and fix, too!
Thanks for you patience.
-- John
Last edited by johnm (2007-06-20 23:44:14)
Offline
Topic closed
Pages: 1