Discuss Scratch

PureFyre
Scratcher
28 posts

Movement not working

In this project I'm working on, the movement locks to up or down, or left or right depending on what you press first. I cannot seem to figure out what is causing this to happen, and I would love some help.

Thanks!
myeducate
Scratcher
500+ posts

Movement not working

PureFyre wrote:

In this project I'm working on, the movement locks to up or down, or left or right depending on what you press first. I cannot seem to figure out what is causing this to happen, and I would love some help.

Thanks!
Have you set the correct rotation mode? Also, have you tried the change X/y blocks instead of the move X steps?
I can't see inside on your project because I'm on my phone, but those are some most common fixes.

INACTIVE
SPA Member and Assosiate - Creator and overlord of ScratchNetwork - 700+ Forum Posts - Web and Desktop Dev - Fluent in VB, PHP and HTML. I'm okay at CSS and Javascript but am still learning. Sig written in PHP using the picture libary. Firebase is fun.

mstone326
Scratcher
1000+ posts

Movement not working

PureFyre wrote:

In this project I'm working on, the movement locks to up or down, or left or right depending on what you press first. I cannot seem to figure out what is causing this to happen, and I would love some help.

Thanks!

You have a few things going on. First, when you let go of the right arrow key the left arrow can't go because you are in a repeat until speed = 0 loop. So the left arrow, or any other arrow, won't work until the speed is 0 and those repeat until loops are exited.

See if this helps. I reworked your scripts to get rid of the repeat until blocks and instead multiplied speed by .9. So when you let go of the arrow it will work its way down to 0. I also added a new variable called Yspeed.

https://scratch.mit.edu/projects/188630166/

High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
PureFyre
Scratcher
28 posts

Movement not working

mstone326 wrote:

PureFyre wrote:

In this project I'm working on, the movement locks to up or down, or left or right depending on what you press first. I cannot seem to figure out what is causing this to happen, and I would love some help.

Thanks!

You have a few things going on. First, when you let go of the right arrow key the left arrow can't go because you are in a repeat until speed = 0 loop. So the left arrow, or any other arrow, won't work until the speed is 0 and those repeat until loops are exited.

See if this helps. I reworked your scripts to get rid of the repeat until blocks and instead multiplied speed by .9. So when you let go of the arrow it will work its way down to 0. I also added a new variable called Yspeed.

https://scratch.mit.edu/projects/188630166/
Thank you so much! Will be sure to credit you in the final project!

Powered by DjangoBB