Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do you make a sprite move with clicks?
- MaggotMush
-
4 posts
How do you make a sprite move with clicks?
I've kind of been thinking of making a game in which you move by clicking on the place that you want to go. But I have no clue how to do this. We have the “go to mouse-pointer” script, but that's all I can think of that could help me with this. I know moving with the arrow keys would be a lot easier to script, but I want to test click movement, does anyone know if this is possible, and how?
- MaggotMush
-
4 posts
How do you make a sprite move with clicks?
I figured something out!
By making a whole new sprite for the background, you can add a message that tells the “player” where to move.
edit : Now the only problem left is figuring out how to set a walking animation when in movement. I'll try troubleshooting, but if anyone has any solutions please hit me up.
By making a whole new sprite for the background, you can add a message that tells the “player” where to move.
edit : Now the only problem left is figuring out how to set a walking animation when in movement. I'll try troubleshooting, but if anyone has any solutions please hit me up.
Last edited by MaggotMush (Oct. 30, 2018 14:43:24)
- deck26
-
1000+ posts
How do you make a sprite move with clicks?
There is a ‘when stage clicked’ hat block as well.
- MaggotMush
-
4 posts
How do you make a sprite move with clicks?
Oh yeah! I forgot about that, thank you. There is a ‘when stage clicked’ hat block as well.
- Stalpinth
-
47 posts
How do you make a sprite move with clicks?
Here is a solution: https://scratch.mit.edu/projects/258536679/
- TheRandomno
-
46 posts
How do you make a sprite move with clicks?
I made a project that moves at a roughly consistent speed and includes basic animation. If you had a sprite designed in overhead view you could change the rotation style to all-around.
It uses the workaround for the glide block which allows you to change costume every frame.
It uses the workaround for the glide block which allows you to change costume every frame.
- iFluxx
-
100+ posts
How do you make a sprite move with clicks?
If you want the sprite to always move when you click, regardless where you click, do
Or you could use broadcasts
- deck26
-
1000+ posts
How do you make a sprite move with clicks?
Mouse down isn't enough - holding the mouse down is not the same as clicking but the forever loop would only check the mouse down. If you want to use @iFluxx's method you're better waiting until mouse down and waiting until not mouse down in the forever loop instead of having the if block.
The second method (broadcast) is one to be careful of. If the receiver gets any longer it may not complete between one broadcast and the next when it will restart.
The second method (broadcast) is one to be careful of. If the receiver gets any longer it may not complete between one broadcast and the next when it will restart.
- iFluxx
-
100+ posts
How do you make a sprite move with clicks?
Oh yeah forgot that lol Mouse down isn't enough - holding the mouse down is not the same as clicking but the forever loop would only check the mouse down. If you want to use @iFluxx's method you're better waiting until mouse down and waiting until not mouse down in the forever loop instead of having the if block.
The second method (broadcast) is one to be careful of. If the receiver gets any longer it may not complete between one broadcast and the next when it will restart.
Last edited by iFluxx (Nov. 1, 2018 18:21:12)
- 3DGamer5
-
69 posts
How do you make a sprite move with clicks?
here is my way, make 2 sprites (one is for the player, one is for the cursor)
Sprite 2:
sprite 1:
and thats it.
BTW here is a template: https://scratch.mit.edu/projects/254200103
Sprite 2:
sprite 1:
and thats it.
BTW here is a template: https://scratch.mit.edu/projects/254200103
Last edited by 3DGamer5 (Nov. 1, 2018 20:38:56)
- Puppy_4_Life
-
1 post
How do you make a sprite move with clicks?
How do you make the background bigger. Meaning like in the minecraft 11v.3 by griffpatch made it possible for you to move around in the background and not have to touch something to change the background to another one. How do you do that?
- PersRufaro
-
100+ posts
How do you make a sprite move with clicks?
Please don't post on old topics, but rather start your own. Try to remember next time. How do you make the background bigger. Meaning like in the minecraft 11v.3 by griffpatch made it possible for you to move around in the background and not have to touch something to change the background to another one. How do you do that?
- People might not respond to your question.
Last edited by PersRufaro (Feb. 16, 2020 05:46:30)
- cs4865242
-
1 post
How do you make a sprite move with clicks?
YOURE GETTING HACJED'
]
]
Last edited by cs4865242 (Feb. 24, 2020 15:49:23)
- Teku_841
-
8 posts
How do you make a sprite move with clicks?
i mean this isnt about when you click and it moves there just reguler moving
- Teku_841
-
8 posts
How do you make a sprite move with clicks?
oh my god ok the if inside of the key a its supposed to go under the other if

- Discussion Forums
- » Help with Scripts
-
» How do you make a sprite move with clicks?