Discuss Scratch

Avocado_Games
Scratcher
25 posts

Mobile controls

I have the basics for a game but I don’t know how to make the mobile joy stick stop moving one way when touching the outside of the ring but still be able to move back to another position.Game…
RT_Borg
Scratcher
1000+ posts

Mobile controls

Hi Avocado_Games,

Here's a very nice sample I turned up with a search:

How to make a joystick in scratch by Polarbear8551
https://scratch.mit.edu/projects/486240453/

Note, in (the poorly named) “Sprite1”, it isn't draggable. The magic happens through an offset costume and directions.

If there's anything in their example that doesn't make sense, just ask.

– RT_Borg
Avocado_Games
Scratcher
25 posts

Mobile controls

RT_Borg wrote:

Hi Avocado_Games,

Here's a very nice sample I turned up with a search:

How to make a joystick in scratch by Polarbear8551
https://scratch.mit.edu/projects/486240453/

Note, in (the poorly named) “Sprite1”, it isn't draggable. The magic happens through an offset costume and directions.

If there's anything in their example that doesn't make sense, just ask.

– RT_Borg
Thanks!

Last edited by Avocado_Games (July 18, 2022 22:31:06)

RT_Borg
Scratcher
1000+ posts

Mobile controls

I see you just edited your last comment.

I made a remix, changing the example to show “change x,y” movement (versus “direction+move” movement). As I say in the code comment, you'll probably need to reverse the speed multiplier for scrolling.

Remix with x,y movement - How to make a joystick in scratch by Polarbear8551
https://scratch.mit.edu/projects/715244297/

– RT_Borg
Avocado_Games
Scratcher
25 posts

Mobile controls

I can’t seem to find the right position to put circle. When I move it around it doesn’t touch the edge on some parts when on others it does. I’ve checked and they’re both perfect circles. What am I doing wrong?
RT_Borg
Scratcher
1000+ posts

Mobile controls

You centered the outside circle at x = -173, but inside the script for the inner circle, you have it going to x = -172. Change those to be the same and they'll look right.

– RT_Borg
Avocado_Games
Scratcher
25 posts

Mobile controls

RT_Borg wrote:

You centered the outside circle at x = -173, but inside the script for the inner circle, you have it going to x = -172. Change those to be the same and they'll look right.

– RT_Borg
Thanks!

Powered by DjangoBB