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

#1 2009-12-08 08:55:24

06dknibbs
Scratcher
Registered: 2008-01-29
Posts: 1000+

Gliding + Go to scripts don't work together?

I'm working on some sprites for a large RPG game I'm making, but I noticed that whenever I put these two scripts together.

<when green flag clicked>
<go to x sad  0 )y sad  0

<when green flag clicked>
<glide( 1 )secs to x sad  100 )y sad  0

The second time I run the script (After the sprite has glided the first time). Instead of going back to 0,0 the sprite stays at 100,0 when it should go back to 0,0 and glide again.

Anyone else having this problem?

Note: It happens with any X's and Y's, they we're just an example.

Last edited by 06dknibbs (2009-12-08 08:55:50)


http://i404.photobucket.com/albums/pp129/06dknibbs/Untitled-3-6.jpg

Offline

 

#2 2009-12-08 09:03:04

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: Gliding + Go to scripts don't work together?

I don't know why you didn't put the glide to block under the go to block? because then it will allways work.

<when green flag clicked>
<go to x sad  0 )y sad  0 ) >
<glide( 1 )secs to x sad  100 )y sad  0 ) >


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#3 2009-12-08 15:20:38

06dknibbs
Scratcher
Registered: 2008-01-29
Posts: 1000+

Re: Gliding + Go to scripts don't work together?

I should have mentioned I changed it to the script you posted (It does work  smile  ). But It's still a bug, right? The Scratch program shouldn't do that...


http://i404.photobucket.com/albums/pp129/06dknibbs/Untitled-3-6.jpg

Offline

 

#4 2009-12-08 15:30:16

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: Gliding + Go to scripts don't work together?

It's because the glide script activated before the go back script, so it couldn't go back (because it was gliding) (so it wasn't a glitch)

Offline

 

#5 2009-12-08 20:02:10

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: Gliding + Go to scripts don't work together?

Look time wise at this problem:
Both scripts are activated at the same time.
Go to block is read                             -----         glide block is read
Stores x & y values for calculations       -----         Stores x & y values for calculations
caculates where the sprite will go        -----         Calculates where the sprite will go
Puts the sprite at the assigned x          ---->        moves the spite the next x & y 
& y values                                          ^         
                                                        ^<-        keeps repeating until script is finished

Now when the glide block is gliding it moves the sprite to the next x & y points from the previous x & y points and so when the goto block is used the sprite moves to the x & y point but then the glide block moves it back to the next x & y point from it's previous x & y point. Meaning that it is not a glitch.


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

Board footer