Discuss Scratch

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/

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?
dem_bot
Scratcher
1000+ posts

Need help with coding.

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!
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 <touching color [] ?> then
set [Collision] to [1]

end

If anyone can help, please do
nateyong
Scratcher
3 posts

Need help with coding.

move () steps
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
nateyong
Scratcher
3 posts

Need help with coding.

oh
CelestialPuff
Scratcher
500+ posts

Need help with coding.

Maybe try
when green flag clicked
if <touching [wall v] ?> then
repeat until <not <touching [wall v] ?>>
move (-1) steps
end
end
This will only work if:
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.

Platformer_Ready wrote:

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.

Powered by DjangoBB