Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do I make a sprite move up and down automatically?
- ScarVf
-
Scratcher
30 posts
How do I make a sprite move up and down automatically?
I'm working on a pong game and the red paddle doesn't move (yet) because I don't know how to make it go up and down with out breaking other parts of it's movement scripts. Here is the link to the game https://scratch.mit.edu/projects/728166245/editor/ please remix it and fix it if you want or can.
ScarVf signing out
ScarVf signing out

Last edited by ScarVf (Sept. 5, 2022 00:41:28)
- legendary34678
-
Scratcher
1000+ posts
How do I make a sprite move up and down automatically?
You can just have it glide up and down in a forever loop like so:
Also, I noticed a bug in your bouncing script which can cause the ball to be trapped by the blue paddle if you time it right. If the ball is bouncing off of the wall, you can quickly move the paddle down and trap the ball, giving you many points. I can help you fix that bug if you would like (which would require you to either change the whole ball movement system or just use a different way of bouncing).
I hope this helped you!
forever
glide (4) secs to x: (-205) y: (200)
glide (4) secs to x: (-205) y: (-200)
end
Also, I noticed a bug in your bouncing script which can cause the ball to be trapped by the blue paddle if you time it right. If the ball is bouncing off of the wall, you can quickly move the paddle down and trap the ball, giving you many points. I can help you fix that bug if you would like (which would require you to either change the whole ball movement system or just use a different way of bouncing).
I hope this helped you!
- ScarVf
-
Scratcher
30 posts
How do I make a sprite move up and down automatically?
THANK YOU OH SO MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

















Oh! And I'm currently fixing the ball getting stuck in the paddle(s) that's actually what I was doing before I checked my mail.


















Oh! And I'm currently fixing the ball getting stuck in the paddle(s) that's actually what I was doing before I checked my mail.

Last edited by ScarVf (Sept. 5, 2022 01:05:48)
- melikescratchlike
-
Scratcher
6 posts
How do I make a sprite move up and down automatically?
nevermind
forever
change y by (10)
change y by (-10)
end
Last edited by melikescratchlike (Jan. 29, 2025 21:02:12)
- zeiraph
-
Scratcher
100+ posts
How do I make a sprite move up and down automatically?
hello I'm making a Sprunki project and when I used @lengendary34678 s code it broke the fact that there supposed to spawn where there placed so I need a script that will just bob them in place and not just fly of to some random place. plz help1. The code is made for certain y and x coordinates so you have to change the coordinates to what you want, if you use that method. 2. please don't necropost (Post on topics that are old or resolved)
- Discussion Forums
- » Help with Scripts
-
» How do I make a sprite move up and down automatically?



