This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-03-12 11:17:15

mkreitler
Scratcher
Registered: 2009-03-12
Posts: 4

Game doesn't work in viewer...how can I get the Java source?

I recently posted a version of Lunar Lander that works fine in Scratch but doesn't start properly in the Java viewer.

Is there a way I can get the Java source locally so I can debug the applet version?

Thanks,

Mark

Offline

 

#2 2009-03-12 15:14:01

mkreitler
Scratcher
Registered: 2009-03-12
Posts: 4

Re: Game doesn't work in viewer...how can I get the Java source?

Update: the Java console reports "doesn't like true as input in eval-comparision" when the game freezes. I assume this means I've got a bad conditional in my program somewhere.

I have downloaded ScratchViewer.jar. I would like to decompile the source and debug in NetBeans to track this problem further. Is this a problem, legally?

Offline

 

#3 2009-03-12 16:07:17

mkreitler
Scratcher
Registered: 2009-03-12
Posts: 4

Re: Game doesn't work in viewer...how can I get the Java source?

I fixed the bug . The problem was a pair of assignment statements of the form:

set myVarible to (x < 3), or

<set{ myVariable }to( <( x <<> 3 )>

I expected (x < 3) to evaluate to a true/false value that would be cast to an appropriate type for the 'set' statement. The fact that I was allowed to plug the green block into the orange 'set' block reinforced this. Unfortunately, it doesn't work.

Offline

 

#4 2009-03-12 16:13:58

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Game doesn't work in viewer...how can I get the Java source?

The source code of the Scratch program, the ScratchAplett and some other things is available at http://scratch.wik.is/Source_Code.


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#5 2009-03-12 16:58:25

mkreitler
Scratcher
Registered: 2009-03-12
Posts: 4

Re: Game doesn't work in viewer...how can I get the Java source?

Thanks, JSO!

Offline

 

Board footer