Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to make a Sprite move with the arrow keys.
- CBaller5
-
1 post
How to make a Sprite move with the arrow keys.
I am making a game in which a circle has to jump up and down and move side to side. I would like to use the arrow keys to move him, but I don't know how. Please help!!!
- deck26
-
1000+ posts
How to make a Sprite move with the arrow keys.
http://scratch.mit.edu/projects/10128431/ is an introductory project from the help pages that covers basic movement. If you want jumping rather than just moving up and down you need to somehow represent gravity but there are hundreds of scripts out there doing this sort of thing. However if you do want help with gravity I'm sure someone will help here.
- ScratchsterOVA9000
-
53 posts
How to make a Sprite move with the arrow keys.
when [up arrow] key pressed
change y by (2)
when [down arrow] key pressed
change y by (-2)
when [left arrow] key pressed
change x by (2)
when [ v] key pressed
change x by (-2)
- g-dog9293
-
100+ posts
How to make a Sprite move with the arrow keys.
For an efficient script, try this….
When Flag Clicked
Forever
If Left Arrow clicked then
change x by -3
If Right Arrow clicked then
change x by 3
If Down Arrow clicked then
change y by -3
If Up Arrow clicked then
change y by 3
Simple as pie! Or was it pi? Who cares?
Try this one!
When Flag Clicked
Forever
If Left Arrow clicked then
change x by -3
If Right Arrow clicked then
change x by 3
If Down Arrow clicked then
change y by -3
If Up Arrow clicked then
change y by 3
Simple as pie! Or was it pi? Who cares?
Try this one!
- LionCubz13
-
1 post
How to make a Sprite move with the arrow keys.
I don't get it still. Can someone help?
- Blobson1
-
20 posts
How to make a Sprite move with the arrow keys.
when green flag clicked
forever
if <key [ up arrow] pressed?> then
change y by (10)
end
if <key [ down arrow] pressed?> then
change y by (-10)
end
if <key [ right arrow] pressed?> then
change x by (10)
end
if <key [ left arrow] pressed?> then
change x by (-10)
end
end
This is how you get a smoother move!
Last edited by Blobson1 (Feb. 9, 2016 16:06:30)
- Discussion Forums
- » Help with Scripts
-
» How to make a Sprite move with the arrow keys.