Discuss Scratch

fortnite_gamer12312
Scratcher
38 posts

how do you make a platform game player move

i need help with this game i dont know how to move
https://scratch.mit.edu/projects/561045368/editor/
dont copy write it
SpaceKitty8
Scratcher
64 posts

how do you make a platform game player move

I'm unsure what you mean, but if you mean how to move the character like just in general then use this.
This is for going right and left.
when green flag clicked
if <key [Right Arrow] pressed?> then
point in direction (90)
set rotation style [Left right]
change x by (2)
end
if <key [left Arrow] pressed?> then
point in direction (-90)
set rotation style [Left right]
change x by (-2)
end
This is for jumping
when green flag clicked
set [Y Velocity] to [10]
forever
if <Key [Up arrow] pressed?> then
if <touching [Ground] ?> then
set [Y Velocity] to [12]
set [Going Up] to [1]
repeat (12)
change y by (Y Velocity)
change [Y Velocity] by (-1)
end
set [Going Up] to (0)
end
end
end
when green flag clicked
forever
if <<not <touching [Ground] ?>> and <[Going Up] = [0]>> then
change y by (Y Velocity)
change [Y Velocity] by (-1)
end
end
Thingied
Scratcher
1000+ posts

how do you make a platform game player move

Reset the velocities when the game starts.

Scratch can't do that many a million things in one frame so you have to reset it back to 0 so it doesn't have to do that many things.

One more thing, make the move custom block run without screen refresh so the player doesn't sink and rise out of the ground.


Last edited by Thingied (Aug. 22, 2021 19:04:03)

Powered by DjangoBB