Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to move diagonal???
- EpikScratchGaemer214
- Scratcher
19 posts
How to move diagonal???
I have a character which i want him to be able to move diagonally. Link to project. https://scratch.mit.edu/projects/988693121/editor/
if <me> then
Sent from Area 51
- kooqle
- Scratcher
100+ posts
How to move diagonal???
Try something like this:
when green flag clicked
repeat (10)
change x by (1)
change y by (1)
end
Anti-rickroll service (we never give you up)!
- kooqle
- Scratcher
100+ posts
How to move diagonal???
Sorry, that might not work. Try something like this:when green flag clickedrepeat (10)
change x by (1)
change y by (1)
end
when green flag clicked
repeat (10)
change x by (1)
change y by (1)
wait (0.1) secs
end
Anti-rickroll service (we never give you up)!
- EpikScratchGaemer214
- Scratcher
19 posts
How to move diagonal???
sorry that doesn't work
if <me> then
Sent from Area 51
- kiwilover2736
- Scratcher
1000+ posts
How to move diagonal???
You don't need to add seperate scripts to move diagonally, because your character will already move diagonally when you hold 2 keys. Though, i do have a few recommendations for the rest of your scripts. Instead of having seperate forever loops for WASD and arrow keys, you could use this script for every key you need:
Remember to delete the old scripts after you add the one i just showed. If your scripts stop working, then please tell me or another person on this topic.
when green flag clicked
forever
if <<key [right arrow key] pressed?> or <key [D] pressed?>> then
change x by (5)
end
end
Remember to delete the old scripts after you add the one i just showed. If your scripts stop working, then please tell me or another person on this topic.
⋆˖⁺‧₊☽ Just a person who helps in and cleans up the Discussion Forums! ☾₊‧⁺˖⋆
⋆˖⁺ I reached 1000 followers in January of 2024 and made an QNA. I'm now done with answering all the questions, and here's the project for it! ⁺˖⋆
⋆˖⁺ One of my projects was featured! :D Check it out here! ⁺˖⋆
⋆˖⁺ Murder Drones fan! ⁺˖⋆ (Note: Murder Drones is an Indie Show.)
———————————————————————————————————————————————
RANDOM SCRATCHERS OUT OF CONTEXT :D
Za-Chary once said..
Could you remind us what scenes are in ScratchJr and what they do?After all, I If this gets rejected, add this to Za-Chary!AM the list of rejected suggestions.
And Paddle2See once said..
This is not a question for this forum. It's a question for your lawyer.
~Congrats! You found secret links. These are just random images that i might use.~
u.cubeupload.com/eason_9_lol/SxrJFv.png
u.cubeupload.com/eason_9_lol/Wf472Y.png
u.cubeupload.com/eason_9_lol/a8wDJ4.png
- TheUltimateHoodie
- Scratcher
1000+ posts
How to move diagonal???
Firstly, you spelt “separate” wrong. You don't need to add seperate scripts to move diagonally, because your character will already move diagonally when you hold 2 keys. Though, i do have a few recommendations for the rest of your scripts. Instead of having seperate forever loops for WASD and arrow keys, you could use this script for every key you need:when green flag clicked
forever
if <<key [right arrow key] pressed?> or <key [D] pressed?>> then
change x by (5)
end
end
Remember to delete the old scripts after you add the one i just showed. If your scripts stop working, then please tell me or another person on this topic.
Secondly, having 2 scripts will delay the second script by one frame. I recommend putting all of the “if” blocks in one script under the forever block.
can somebody give me something to put in my signature
- kiwilover2736
- Scratcher
1000+ posts
How to move diagonal???
Okay.Firstly, you spelt “separate” wrong. You don't need to add seperate scripts to move diagonally, because your character will already move diagonally when you hold 2 keys. Though, i do have a few recommendations for the rest of your scripts. Instead of having seperate forever loops for WASD and arrow keys, you could use this script for every key you need:when green flag clicked
forever
if <<key [right arrow key] pressed?> or <key [D] pressed?>> then
change x by (5)
end
end
Remember to delete the old scripts after you add the one i just showed. If your scripts stop working, then please tell me or another person on this topic.
Secondly, having 2 scripts will delay the second script by one frame. I recommend putting all of the “if” blocks in one script under the forever block.
(You didn't have to note a single spelling mistake.)
⋆˖⁺‧₊☽ Just a person who helps in and cleans up the Discussion Forums! ☾₊‧⁺˖⋆
⋆˖⁺ I reached 1000 followers in January of 2024 and made an QNA. I'm now done with answering all the questions, and here's the project for it! ⁺˖⋆
⋆˖⁺ One of my projects was featured! :D Check it out here! ⁺˖⋆
⋆˖⁺ Murder Drones fan! ⁺˖⋆ (Note: Murder Drones is an Indie Show.)
———————————————————————————————————————————————
RANDOM SCRATCHERS OUT OF CONTEXT :D
Za-Chary once said..
Could you remind us what scenes are in ScratchJr and what they do?After all, I If this gets rejected, add this to Za-Chary!AM the list of rejected suggestions.
And Paddle2See once said..
This is not a question for this forum. It's a question for your lawyer.
~Congrats! You found secret links. These are just random images that i might use.~
u.cubeupload.com/eason_9_lol/SxrJFv.png
u.cubeupload.com/eason_9_lol/Wf472Y.png
u.cubeupload.com/eason_9_lol/a8wDJ4.png
- EpikScratchGaemer214
- Scratcher
19 posts
How to move diagonal???
Thanks
if <me> then
Sent from Area 51
- BrilliantStar114
- Scratcher
100+ posts
How to move diagonal???
Do like this:
if <key [e v] pressed?> then
change x by (2)
change y by (2)
end
My pictures shop! ★ Visit if you need any picture! ★ Just click here!
Are you a good artist? Do you like drawing and scratching? Join my collab!
Ortographic errors in Scratch in Spanish (translation to English available)
Thank you for 50 followers! My 50 followers anything contest!
Sister: @CutePinkCat14
Shoutout (this scratcher is underrated): @Chap113311
All the things in my signature are links. Click in them to go to the page. (Obviously, this is not a link)
- BrilliantStar114
- Scratcher
100+ posts
How to move diagonal???
https://scratch.mit.edu/projects/988693121/editor/I have a character which i want him to be able to move diagonally. Link to project.
I remixed your project with diagonal moves! Try it! And I added a monster because the original project was boring… haha
https://scratch.mit.edu/projects/989101412/
My pictures shop! ★ Visit if you need any picture! ★ Just click here!
Are you a good artist? Do you like drawing and scratching? Join my collab!
Ortographic errors in Scratch in Spanish (translation to English available)
Thank you for 50 followers! My 50 followers anything contest!
Sister: @CutePinkCat14
Shoutout (this scratcher is underrated): @Chap113311
All the things in my signature are links. Click in them to go to the page. (Obviously, this is not a link)
- LUKiCREATE
- Scratcher
17 posts
How to move diagonal???
If you want, you can also do this for even less blocks:
(yes, if you didn't know, you can put booleans in number inputs)
when green flag clicked
forever
change x by ((<<key [right arrow v] pressed?> or <key [d v] pressed?>> - <<key [left arrow v] pressed?> or <key [a v] pressed?>>) * (5))
change y by ((<<key [up arrow v] pressed?> or <key [w v] pressed?>> - <<key [down arrow v] pressed?> or <key [s v] pressed?>>) * (5))
end
(yes, if you didn't know, you can put booleans in number inputs)
Some cool projects
Check out other cool projects here: LUKiGAMES (studio)
Check out other cool projects here: LUKiGAMES (studio)
- Apollo11LeoTutorials
- Scratcher
3 posts
How to move diagonal???
when green flag clicked
repeat (10)
change x by (1)
change y by (1)
wait (0) secs
end
- TheRealRldFan
- Scratcher
36 posts
How to move diagonal???
when green flag clicked
forever
change x by (~)
change y by (~)
wait (0.01) secs
end
Last edited by TheRealRldFan (March 25, 2024 15:53:07)
- Discussion Forums
- » Help with Scripts
- » How to move diagonal???