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

#1 2007-06-08 08:37:28

jsimone
Scratcher
Registered: 2007-05-20
Posts: 28

Bug in java applet when reversing sprite direction.

I just posted a new project at :

http://scratch.mit.edu/projects/jsimone/11518

However, it works improperly in the java applet.  On desktop Scratch, Dan stays on the ground.  But in the java applet Dan starts to fly off the ground even though we don't affect the y-position at all.  Every time, he bounces off the edge he moves up in y-position.

Strange!

Offline

 

#2 2007-06-08 09:56:08

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Bug in java applet when reversing sprite direction.

The problem may be that the initial direction is not exactly 90 degrees in the java implementation.  The if-tests fail and things get gradually worse.

I tried replacing "if direction=-90" with "if direction<0" and "if direction=90" with "if direction>0" and everything worked ok in both squeak and java.

Offline

 

#3 2007-06-08 10:35:06

jsimone
Scratcher
Registered: 2007-05-20
Posts: 28

Re: Bug in java applet when reversing sprite direction.

Thanks Kevin, that fixed the problem.  There must be a rounding error in the java applet as you mentioned.

In the java applet the direction would slowly "creep" upward and downward at 90 +/- degrees.

Offline

 

Board footer