Discuss Scratch

SlimeKing145
Scratcher
32 posts

Why is the controls not working ?

It’s sussposed to be smooth movement (this is a mobile platformer)
Here is the code

when I receive [Start Platformer v]
set [x speed v] to [0]
forever
if <<mouse down?> and <(mouse x) > (x position)>> then
change [x speed v] by (1)
end
if <<mouse down?> and <(mouse x) < (x position)>> then
change [x speed v] by (-1)
end
change x by (x speed)
end
SlimeKing145
Scratcher
32 posts

Why is the controls not working ?

the blocks are connected btw sorry if it looks like they aren’t
user10234576
Scratcher
34 posts

Why is the controls not working ?

If it isn’t slowing down, add something like
set [ x speed] to ((x speed) / (1.5))
to the loop
If it isn’t slowing down fast enough, make the number on the right side bigger
SlimeKing145
Scratcher
32 posts

Why is the controls not working ?

Thank you, I hope it works.
SlimeKing145
Scratcher
32 posts

Why is the controls not working ?

and it isn’t going faster too idk why, it stays at the same speed

Last edited by SlimeKing145 (March 8, 2025 20:20:04)

user10234576
Scratcher
34 posts

Why is the controls not working ?

It stays at a certain speed after some time of moving cause that’s the max speed of the player. You can increase it by decreasing the number x speed is divided by
SlimeKing145
Scratcher
32 posts

Why is the controls not working ?

Ok it works now and the platformer is finished but the broadcast to start the platformer isn’t working idk why

Last edited by SlimeKing145 (March 8, 2025 21:58:48)

Powered by DjangoBB