Discuss Scratch

1wings_of_fire_fan
Scratcher
62 posts

Smooth motion with arrow keys

I’m creating a maze game and want a smooth motion but still controlled by the arrow keys
bsteichman
Scratcher
500+ posts

Smooth motion with arrow keys

arrow keys usually provide smooth motion, since you did not show us the issue with your code, or your code, i am going to assume you are using
when [left arrow v] key pressed
change x by (-1)
when [up arrow v] key pressed
change y by (1)
when [down arrow v] key pressed
change y by (-1)
when [right arrow v] key pressed
change x by (1)
instead use:
when green flag clicked
forever
if <key [left arrow v] pressed> then
change x by (-1)
end
if <key [right arrow v] pressed> then
change x by (1)
end
if <key [up arrow v] pressed> then
change y by (1)

end
if <key [down arrow v] pressed> then
change y by (-1)

end
end
1wings_of_fire_fan
Scratcher
62 posts

Smooth motion with arrow keys

Thank you yes I am using the first ones I will try this code

Powered by DjangoBB