Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Levels problem
- sk321
- New to Scratch
4 posts
Levels problem
I have a problem in my game Levels. When I put the scripts on how to move, and I moved it with the way the scripts showed me to, the square would move a lot sometimes, and a little some other times, even though I told it only to move 3 steps. Please help me. Here is the link(below).
Levels link
Levels link
- flun
- Scratcher
85 posts
Levels problem
There are two ways you can fix the problem, pick whichever one you want:
1. Go to the costume editor for sprite 3 (the green one), look in the top right corner there should be a little plus sign with a dot in the middle so click that, then click the center of the green square. Problem solved.
2. Make it so it changes x by 3 when right pressed, changes x by -3 when left pressed, changes y by 3 when up pressed, and changes y by -3 when down pressed. Problem solved. (here Ill show you the script so it's easier)
1. Go to the costume editor for sprite 3 (the green one), look in the top right corner there should be a little plus sign with a dot in the middle so click that, then click the center of the green square. Problem solved.
2. Make it so it changes x by 3 when right pressed, changes x by -3 when left pressed, changes y by 3 when up pressed, and changes y by -3 when down pressed. Problem solved. (here Ill show you the script so it's easier)
when green flag clicked
forever
if <key [right arrow ] pressed?> then
change x by (3)
end
if <key [left arrow ] pressed?> then
change x by (-3)
end
if <key [up arrow ] pressed?> then
change y by (3)
end
if <key [down arrow ] pressed?> then
change y by (-3)
end
end
forever
start project
work on it
abandon it
end
- ShadowScizor
- Scratcher
100+ posts
Levels problem
The problem is in the
There is two way to solve your problem:
1. Re-position the green block to the center in the costume
2. Instead of
For example:
either method will work, if you still do not understand, feel free to clarify
point in direction ( v)block. This block will change the direction of the sprite in relative to the center of the sprite in the costume. And that cause the problem in your case.
There is two way to solve your problem:
1. Re-position the green block to the center in the costume
2. Instead of
point in direction ( v),use
move () steps
change x by ()
change y by ()
For example:
when [right arrow v] key pressed*Do not confuse x with y (x controls left and right, y controls up and down)
change x by (3)
when [left arrow v] key pressed
change x by (-3)
when [up arrow v] key pressed
change y by (3)
when [down arrow v] key pressed
change y by (-3)
either method will work, if you still do not understand, feel free to clarify
Last edited by ShadowScizor (Dec. 31, 2014 03:39:48)
———– When you stare at the void, the void stares back at you ————
Common scripts:
Username saving script: http://scratch.mit.edu/projects/22268003/
Simple platform script: http://scratch.mit.edu/projects/18003346/
Complex platform script: http://scratch.mit.edu/projects/19481751/
- flun
- Scratcher
85 posts
Levels problem
The second option will make it run smoother than the first though. There are two ways you can fix the problem, pick whichever one you want:
1. Go to the costume editor for sprite 3 (the green one), look in the top right corner there should be a little plus sign with a dot in the middle so click that, then click the center of the green square. Problem solved.
2. Make it so it changes x by 3 when right pressed, changes x by -3 when left pressed, changes y by 3 when up pressed, and changes y by -3 when down pressed. Problem solved. (here Ill show you the script so it's easier)when green flag clicked
forever
if <key [right arrow ] pressed?> then
change x by (3)
end
if <key [left arrow ] pressed?> then
change x by (-3)
end
if <key [up arrow ] pressed?> then
change y by (3)
end
if <key [down arrow ] pressed?> then
change y by (-3)
end
end
forever
start project
work on it
abandon it
end
- flun
- Scratcher
85 posts
Levels problem
copier :p lol jk The problem is in thepoint in direction ( v)block. This block will change the direction of the sprite in relative to the center of the sprite in the costume. And that cause the problem in your case.
There is two way to solve your problem:
1. Re-position the green block to the center in the costume
2. Instead ofpoint in direction ( v),use
move () stepschange x by ()change y by ()either method will work, if you still do not understand, feel free to clarify
forever
start project
work on it
abandon it
end
- ShadowScizor
- Scratcher
100+ posts
Levels problem
not copied, but a little latecopier :p lol jk The problem is in thepoint in direction ( v)block. This block will change the direction of the sprite in relative to the center of the sprite in the costume. And that cause the problem in your case.
There is two way to solve your problem:
1. Re-position the green block to the center in the costume
2. Instead ofpoint in direction ( v),use
move () stepschange x by ()change y by ()either method will work, if you still do not understand, feel free to clarify
———– When you stare at the void, the void stares back at you ————
Common scripts:
Username saving script: http://scratch.mit.edu/projects/22268003/
Simple platform script: http://scratch.mit.edu/projects/18003346/
Complex platform script: http://scratch.mit.edu/projects/19481751/
- flun
- Scratcher
85 posts
Levels problem
hey, great minds think alike xDnot copied, but a little latecopier :p lol jk The problem is in thepoint in direction ( v)block. This block will change the direction of the sprite in relative to the center of the sprite in the costume. And that cause the problem in your case.
There is two way to solve your problem:
1. Re-position the green block to the center in the costume
2. Instead ofpoint in direction ( v),use
move () stepschange x by ()change y by ()either method will work, if you still do not understand, feel free to clarify
forever
start project
work on it
abandon it
end
- ShadowScizor
- Scratcher
100+ posts
Levels problem
@flun haha
———– When you stare at the void, the void stares back at you ————
Common scripts:
Username saving script: http://scratch.mit.edu/projects/22268003/
Simple platform script: http://scratch.mit.edu/projects/18003346/
Complex platform script: http://scratch.mit.edu/projects/19481751/
- AonymousGuy
- Scratcher
1000+ posts
Levels problem
You should still center the sprite no matter what to avoid further issues.
- Discussion Forums
- » Help with Scripts
- » Levels problem