Discuss Scratch

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

A signature is a small piece of text that is attached to your posts. In it, you can enter just about anything you like. Perhaps you would like to enter your favourite quote or your star sign. It's up to you! In your signature you can use BBCode if it is allowed in this particular forum. You can see the features that are allowed/enabled listed below whenever you edit your signature.

when [ follow v] key pressed
think [thanks!] for (2) secs
kooqle
Scratcher
100+ posts

How to move diagonal???

kooqle wrote:

Try something like this:
when green flag clicked
repeat (10)
change x by (1)
change y by (1)

end
Sorry, that might not work.
when green flag clicked
repeat (10)
change x by (1)
change y by (1)
wait (0.1) secs

end

A signature is a small piece of text that is attached to your posts. In it, you can enter just about anything you like. Perhaps you would like to enter your favourite quote or your star sign. It's up to you! In your signature you can use BBCode if it is allowed in this particular forum. You can see the features that are allowed/enabled listed below whenever you edit your signature.

when [ follow v] key pressed
think [thanks!] for (2) secs
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:

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..

Za-Chary wrote:

Could you remind us what scenes are in ScratchJr and what they do?

alphabetlorefan2003 wrote:

If this gets rejected, add this to Za-Chary!
After all, I AM the list of rejected suggestions.


And Paddle2See once said..

Paddle2See wrote:

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???

kiwilover2736 wrote:

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.
Firstly, you spelt “separate” wrong.
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???

TheUltimateHoodie wrote:

kiwilover2736 wrote:

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.
Firstly, you spelt “separate” wrong.
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.
Okay.
(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..

Za-Chary wrote:

Could you remind us what scenes are in ScratchJr and what they do?

alphabetlorefan2003 wrote:

If this gets rejected, add this to Za-Chary!
After all, I AM the list of rejected suggestions.


And Paddle2See once said..

Paddle2See wrote:

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
BrilliantStar114
Scratcher
100+ posts

How to move diagonal???

EpikScratchGaemer214 wrote:

I have a character which i want him to be able to move diagonally. Link to project. https://scratch.mit.edu/projects/988693121/editor/

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/
LUKiCREATE
Scratcher
17 posts

How to move diagonal???

If you want, you can also do this for even less blocks:

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)
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)

Powered by DjangoBB