Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Need help with coding.
- Platformer_Ready
-
Scratcher
5 posts
Need help with coding.
I have a game I am working on where I am trying to make a walk cycle work.
I want to make it so when the mouse is down, the person moves, and when it reaches the spot, the mouse was when it was clicked, it goes back to the idle animation. I can make the person move, but I cannot figure out how to make the walk cycle start or stop if it does start.
Can anyone please help?
I have the project link in this post, please explain if you know how to do this.
https://scratch.mit.edu/projects/1298994157/
I want to make it so when the mouse is down, the person moves, and when it reaches the spot, the mouse was when it was clicked, it goes back to the idle animation. I can make the person move, but I cannot figure out how to make the walk cycle start or stop if it does start.
Can anyone please help?
I have the project link in this post, please explain if you know how to do this.
https://scratch.mit.edu/projects/1298994157/
Last edited by Platformer_Ready (April 3, 2026 19:26:22)
- Foxy_flamez
-
Scratcher
6 posts
Need help with coding.
Im not sure but maybe just make it so when touching the mouse the sprite switches to
when green flag clicked
forever
if <touching [mouse pointer v] ?> then
switch costume to [idle v]
end
end
Last edited by Foxy_flamez (April 3, 2026 18:53:21)
- Platformer_Ready
-
Scratcher
5 posts
Need help with coding.
This did work, thank you.
Would you know how to make the walk cycle work?
Would you know how to make the walk cycle work?
- SuleimanBelKiber1
-
Scratcher
5 posts
Need help with coding.
See my profile, here a project with text label: “Remix It!”
Just Remix and make your own Scroll Bar!
Just Remix and make your own Scroll Bar!- Platformer_Ready
-
Scratcher
5 posts
Need help with coding.
Thanks everyone for the help so far, but now I do need help with another thing. I need a collision system, and IDK how to make one. I'm using
If anyone can help, please do
if <touching color [] ?> then
set [Collision] to [1]
end
If anyone can help, please do
- Platformer_Ready
-
Scratcher
5 posts
Need help with coding.
Oh, I'm sorry, I didnt explain. This project doesnt use arrow keys, it uses your mouse to move.
- nateyong
-
Scratcher
3 posts
Need help with coding.
forever
if <> then
<key [ w] pressed?>
if <> then
<touching color [#1b37da] ?>
else
move (10) steps
end
end
end
- CelestialPuff
-
Scratcher
500+ posts
Need help with coding.
Maybe try
1. You change direction to where you walk
2. You use a custom block that runs without screen refresh and put the repeat in the define
3. You put the custom block where the repeat was
when green flag clickedThis will only work if:
if <touching [wall v] ?> then
repeat until <not <touching [wall v] ?>>
move (-1) steps
end
end
1. You change direction to where you walk
2. You use a custom block that runs without screen refresh and put the repeat in the define
3. You put the custom block where the repeat was
- benguinthepenguin
-
Scratcher
100+ posts
Need help with coding.
I have a game I am working on where I am trying to make a walk cycle work.
I want to make it so when the mouse is down, the person moves, and when it reaches the spot, the mouse was when it was clicked, it goes back to the idle animation. I can make the person move, but I cannot figure out how to make the walk cycle start or stop if it does start.
Can anyone please help?
I have the project link in this post, please explain if you know how to do this.
https://scratch.mit.edu/projects/1298994157/
when green flag clicked
forever
if <mouse down?> then
next costume
wait (0.5) secs
else
switch costume to [Idle v]
end
end
- Platformer_Ready
-
Scratcher
5 posts
Need help with coding.
Okay, thank you all for helping. I Figured out how to work it.
- Discussion Forums
- » Help with Scripts
-
» Need help with coding.