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

#1 2010-04-14 18:33:47

tobydanger
Scratcher
Registered: 2010-03-18
Posts: 22

Possible difference in Web Applet vs Environment

In this project

http://scratch.mit.edu/projects/tobydanger/984500

There is some rather essoteric code that checks for a collision in each "alien" sprite with a number of "shot" sprites. The name of the sprite to check is constructed by joining a shot name and a number in a variable. The variable is used in a touching block. It works in Scratch but not in the applet.

Here is the some psudo code because some of the option sare not availiable with the blocks option

set PlayerShotIndex to 0
repeat 5
  change PlayerShotIndex By 1
  set PlayerShotName to  Join "PlayerShot" PlayerShotIndex
  if  Is Touching PlayerShotName
    Do some stuff
  end if
end repeat

Offline

 

#2 2010-04-14 19:14:06

tobydanger
Scratcher
Registered: 2010-03-18
Posts: 22

Re: Possible difference in Web Applet vs Environment

Here is a simpler application that demonstrates the issue.

http://scratch.mit.edu/projects/tobydanger/986536

It works in Scratch but not on the website.

Offline

 

#3 2010-04-15 08:32:48

Phi_Lho
Scratcher
Registered: 2010-03-22
Posts: 75

Re: Possible difference in Web Applet vs Environment

Basically the recent answer Uploaded Project Doesn't Run Properly provides already elements of response.

Your method is a smart simulation of array, it is surprising and interesting to see it works. But it just cannot work in Java, unless addressing precisely this kind of coding in the translator.


http://i241.photobucket.com/albums/ff159/PhiLho/KM150.pnghttp://i241.photobucket.com/albums/ff159/PhiLho/PhiLhoLogo.png

Offline

 

#4 2010-04-15 17:31:08

tobydanger
Scratcher
Registered: 2010-03-18
Posts: 22

Re: Possible difference in Web Applet vs Environment

Here is what the Scratch Team had to say:

Scratch Team wrote:

Hi Toby,

Thanks for submitting this - and thanks especially for making a project that clearly demonstrates the bug! We've got this on our list of things to fix, and now we have a great test project. Hopefully we can get this one taken care of in the not too distant future.

Scratch On!
Amos
Scratch Team

Awesome !

Offline

 

Board footer