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
0 )y
0
<when green flag clicked>
<glide( 1 )secs to x
100 )y
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)
Offline
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
0 )y
0 ) >
<glide( 1 )secs to x
100 )y
0 ) >
My site Offline
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
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.
My site Offline