Discuss Scratch

jhuang0044
Scratcher
14 posts

Why does my sprite move up but sometimes moves down?



The code here makes the sprite move up and down. However, it starts off moving up and then down and other times it moves down and then up which covers some of my sprites, when it moves down and then up. How do I get to only move up and then down?
SpyCoderX
Scratcher
1000+ posts

Why does my sprite move up but sometimes moves down?

Just put a “set move up to 0” right above the forever loop.
when I receive [first scene v]
switch costume to [character v]
set [move up v] to (0)
forever
change y by ((0.5)*([sin v] of (move up)))
change [move up v] by (2.5)
end
jhuang0044
Scratcher
14 posts

Why does my sprite move up but sometimes moves down?

SpyCoderX wrote:

Just put a “set move up to 0” right above the forever loop.
when I receive [first scene v]
switch costume to [character v]
set [move up v] to (0)
forever
change y by ((0.5)*([sin v] of (move up)))
change [move up v] by (2.5)
end
Thanks!
SpyCoderX
Scratcher
1000+ posts

Why does my sprite move up but sometimes moves down?

jhuang0044 wrote:

SpyCoderX wrote:

Just put a “set move up to 0” right above the forever loop.
when I receive [first scene v]
switch costume to [character v]
set [move up v] to (0)
forever
change y by ((0.5)*([sin v] of (move up)))
change [move up v] by (2.5)
end
Thanks!
You’re welcome!

Powered by DjangoBB