Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Change X while gliding to a Y.
- superkittyboy
-
Scratcher
25 posts
Change X while gliding to a Y.
I recently encountered a problem, in the game I'm creating. I tried to make a sprite, glide to the Y of 200, using the
This, by itself worked perfectly. It'd glide at the variable's speed, to Y 200, and then run its next scripts. Though, I needed it to change it's X, several times, while gliding- So I created another script:
The variable, was set to the X of a constantly moving separate sprite.
This however, didn't work. My initial sprite, would ignore that script, and glide to the last value the variable was set too.
I know that the “Glide” block, stops it's other scripts while Gliding. Though, is there a way to bypass this? I've attempted to use
block, and well- It worked. Though, it doesn't have the same effect, that the Gliding block has. Is there another way, to achieve the Glide “seconds” effect, and still change the X, constantly while gliding?
glide (speed) secs to x: (MyX) y: (200)block.
This, by itself worked perfectly. It'd glide at the variable's speed, to Y 200, and then run its next scripts. Though, I needed it to change it's X, several times, while gliding- So I created another script:
when green flag clickedend
forever
set x to (MyX)
The variable, was set to the X of a constantly moving separate sprite.
This however, didn't work. My initial sprite, would ignore that script, and glide to the last value the variable was set too.
I know that the “Glide” block, stops it's other scripts while Gliding. Though, is there a way to bypass this? I've attempted to use
repeat ()
change y by (5)
end
block, and well- It worked. Though, it doesn't have the same effect, that the Gliding block has. Is there another way, to achieve the Glide “seconds” effect, and still change the X, constantly while gliding?
Last edited by superkittyboy (Jan. 22, 2022 18:17:06)
- Ham19-01-2011
-
Scratcher
1000+ posts
Change X while gliding to a Y.
Why don't you put MyX instead of the 0? It might work
Last edited by Ham19-01-2011 (Jan. 22, 2022 18:08:33)
- superkittyboy
-
Scratcher
25 posts
Change X while gliding to a Y.
Oop- I posted that, without finishing– my bad XD Refresh the page- Hopefully the new stuff'll show up.
- Discussion Forums
- » Help with Scripts
-
» Change X while gliding to a Y.