Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » help with sprite movement code
- kingofcool4
-
29 posts
help with sprite movement code
my sprites movement script is currently this:
define movex (keyx)
change by ((0.95) * (key x (this is a my block input idk if it will show as pink or orange))
set to ((0.95) * (x speed))
change x by (x speed)
also this:
define movey (y value)
change by ((0.95) * (key y (this is a my block input idk if it will show as pink or orange))
set to ((0.95) * (y speed))
change y by (y speed)
this are some other scripts used to move:
How do I make the character move faster?
define movex (keyx)
change by ((0.95) * (key x (this is a my block input idk if it will show as pink or orange))
set to ((0.95) * (x speed))
change x by (x speed)
also this:
define movey (y value)
change by ((0.95) * (key y (this is a my block input idk if it will show as pink or orange))
set to ((0.95) * (y speed))
change y by (y speed)
this are some other scripts used to move:
How do I make the character move faster?
Last edited by kingofcool4 (Feb. 2, 2025 22:41:31)
- kittyje1
-
83 posts
help with sprite movement code
You could try putting a multiply block around the input in the movex and movey blocks. But it's kind of hard to read for me. Do you think you can put everything in blocks please? Thank you.
- kingofcool4
-
29 posts
help with sprite movement code
do you mean like put the subtract operator in the multipying one or put the key pressed sensor in a multiplier
- kingofcool4
-
29 posts
help with sprite movement code
Scratcher You could try putting a multiply block around the input in the movex and movey blocks. But it's kind of hard to read for me. Do you think you can put everything in blocks please? Thank you.
25 posts
help with sprite movement code
do you mean like put the subtract operator in the multipying one or put the key pressed sensor in a multiplier
- kingofcool4
-
29 posts
help with sprite movement code
I could attach an image of the script You could try putting a multiply block around the input in the movex and movey blocks. But it's kind of hard to read for me. Do you think you can put everything in blocks please? Thank you.
- kittyje1
-
83 posts
help with sprite movement code
…snip…
do you mean like put the subtract operator in the multipying one or put the key pressed sensor in a multiplier
Like this:
- kingofcool4
-
29 posts
help with sprite movement code
…snip…
do you mean like put the subtract operator in the multipying one or put the key pressed sensor in a multiplier
Like this:
thanks! it actually works!
- Discussion Forums
- » Help with Scripts
-
» help with sprite movement code