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

#1 2007-07-08 20:28:52

Larry828
Scratcher
Registered: 2007-05-30
Posts: 100+

Space key doesn't work online, but fine at home!

I modified a project ("target_practice" by KSMscratchers) and with their permission uploaded my version.  Online, the Space key doesn't shoot the arrow.

So I deleted the project, tested it here, then uploaded it again.  Same problem.

Then I changed the "shoot" key to the Right Arrow key.  Same experience online.

(Sometimes, online, when I press the Space key the effect is to jump down the page!  Each press of the Spacekey jumps down farther.)

None of my uploaded projects has had this problem.  Any ideas what could be wrong?

Thanks!

Offline

 

#2 2007-07-08 22:44:34

Bloing_Gloing
Scratcher
Registered: 2007-05-11
Posts: 27

Re: Space key doesn't work online, but fine at home!

Try clicking on the box where the project appears, then pressing the button. That might work.

Offline

 

#3 2007-07-08 23:15:41

Larry828
Scratcher
Registered: 2007-05-30
Posts: 100+

Re: Space key doesn't work online, but fine at home!

Bloing_Gloing wrote:

Try clicking on the box where the project appears, then pressing the button. That might work.

I went back and tried that again, but no luck.  I've stopped all the action, then restarted the program....no luck.   I've clicked on the Green Flag even while the project was running....no luck.

The original author downloaded the project to their computer and told me it works fine there.  And here at home.   Just not online.

Thanks...

Offline

 

#4 2007-07-09 00:23:25

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

Re: Space key doesn't work online, but fine at home!

I downloaded the project and tried simplifying it. 

At first I thought the problem was with the java implementation not scheduling other events often enough when doing a glide. 

But I removed the glides and still got clearly buggy behavior.

There is a simpler debug version of the project at http://www.soe.ucsc.edu/~karplus/scratch_programs/target_practice-KSMscratchers-2-fixed.sb

There seems to be some serious bugs in v15---the normal tricks for making the java iimplementation work did not seem to apply to this project.

Offline

 

#5 2007-07-09 00:27:28

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

Re: Space key doesn't work online, but fine at home!

v16, which was just installed, also seems to be broken.

Offline

 

#6 2007-07-09 09:48:29

Bloing_Gloing
Scratcher
Registered: 2007-05-11
Posts: 27

Re: Space key doesn't work online, but fine at home!

Is the code:
forever
   something
   if key space pressed
      fire
   end if
   something
end forever
or
when key space pressed
fire?
The first one always works for me, but the second one doesn't always.

Offline

 

#7 2007-07-09 18:27:30

Larry828
Scratcher
Registered: 2007-05-30
Posts: 100+

Re: Space key doesn't work online, but fine at home!

kevin_karplus wrote:

I downloaded the project and tried simplifying it... 

There seems to be some serious bugs in v15---the normal tricks for making the java iimplementation work did not seem to apply to this project.

Thanks, Kevin.  (I'm Larry828 who modified the scripts in KSMscratchers' nice program.)  I see your "Wait..." statements added to the loops.  One of the forum entries had mentioned doing that (maybe one of your entries) but I didn't know exactly where they should be.

For the moment I'm assuming this would work online if uploaded.  There are so many authors and revisers at this point that it wouldn't be right for it to end up in my own account, so I'll file your remedies away for future reference if I upload something of my own.

You're a frequent commenter and submitter who's extremely helpful to all of us who are just learning.  Thank you for all your help!

Offline

 

#8 2007-07-09 22:03:36

Larry828
Scratcher
Registered: 2007-05-30
Posts: 100+

Re: Space key doesn't work online, but fine at home!

Larry828 wrote:

kevin_karplus wrote:

I downloaded the project and tried simplifying it... 

There seems to be some serious bugs in v15---the normal tricks for making the java iimplementation work did not seem to apply to this project.

Thanks, Kevin.  (I'm Larry828 who modified the scripts in KSMscratchers' nice program.)  I see your "Wait..." statements added to the loops.  One of the forum entries had mentioned doing that (maybe one of your entries) but I didn't know exactly where they should be.

For the moment I'm assuming this would work online if uploaded.  There are so many authors and revisers at this point that it wouldn't be right for it to end up in my own account, so I'll file your remedies away for future reference if I upload something of my own.

You're a frequent commenter and submitter who's extremely helpful to all of us who are just learning.  Thank you for all your help!

Offline

 

#9 2007-07-09 22:08:03

Larry828
Scratcher
Registered: 2007-05-30
Posts: 100+

Re: Space key doesn't work online, but fine at home!

Kevin, I added some further credits to the background and uploaded the project since the one online doesn't work.

But the debug version didn't either.  When I pressed the Space key the arrow didn't move.  All it did was change costume to the "YOU WIN!!!" version.

So I deleted the project again.

This has been quite difficult to get working.  I'm just glad that KSMscratchers, the original author, was able to download the few changes I made and see them work fine on their own computer...

Your debug version, of course, works fine on my computer too.  And I appreciate all the script changes you made since they're more logical and simpler than mine.  It's a great way for me to learn how to improve my code.    Thanks!!

Offline

 

#10 2007-07-09 22:25:09

S65
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: Space key doesn't work online, but fine at home!

The same thing is happening to my Gradient Painting project

Offline

 

#11 2007-07-10 07:20:05

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

Re: Space key doesn't work online, but fine at home!

Yes, I'm pretty sure there is a genuine bug in the java implementation that is triggered by this program, and I hope that the scratch team has someone working on it.  I suspect that the patches to the scheduler for the java implementation messed up the "when key pressed" code, but this is pure conjecture on my part, as I have never seen the code.

Offline

 

Board footer