Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do i make a "platformer"
- D3STR0Y3R1
-
Scratcher
21 posts
How do i make a "platformer"
So how do I make it to where the sprite doesnt just phase through the platforms and actually stays on and able to jump to different platforms?
- NeonG4
-
Scratcher
1000+ posts
How do i make a "platformer"
So how do I make it to where the sprite doesnt just phase through the platforms and actually stays on and able to jump to different platforms?With something as big as a platformer game, you should use a tutorial. I would recommend @griffatch's platform tutorial.
- CatU38
-
Scratcher
42 posts
How do i make a "platformer"
you can search some tutorials or templates in scratch, But in case you will need:
A Player Sprite
A Hitbox Sprite
And a Ground Sprite
Example Script for Hitbox (Not Working):
Obviously, I'm not an expert in scrolling platformers so you could use some tutorials at your own way and learn from those tutorials
I hope you find the right way to do it
A Player Sprite
A Hitbox Sprite
And a Ground Sprite
Example Script for Hitbox (Not Working):
when I receive [Start v]
show
set size to (100) %
go to front
forever
Move
end
define Move
if <<key [right arrow v] pressed?> or <key [ d] pressed?>> then
repeat until <<key [right arrow v] pressed?> or <key [d v] pressed?>>
change x by (10)
else
end
Obviously, I'm not an expert in scrolling platformers so you could use some tutorials at your own way and learn from those tutorials

I hope you find the right way to do it

Last edited by CatU38 (May 26, 2023 16:41:56)
- NeonG4
-
Scratcher
1000+ posts
How do i make a "platformer"
you can search some tutorials or templates in scratch, But in case you will need:You most likely wouldn't want the hitbox to be a separate sprite.
A Player Sprite
A Hitbox Sprite
And a Ground Sprite
Example Script for Hitbox (Not Working):when I receive [Start v]
show
set size to (100) %
go to front
forever
Move
enddefine Move
if <<key [right arrow v] pressed?> or <key [ d] pressed?>> then
repeat until <<key [right arrow v] pressed?> or <key [d v] pressed?>>
change x by (10)
else
end
Obviously, I'm not an expert in scrolling platformers so you could use some tutorials at your own way and learn from those tutorials
I hope you find the right way to do it
- --Robinflight--
-
Scratcher
40 posts
How do i make a "platformer"
So how do I make it to where the sprite doesnt just phase through the platforms and actually stays on and able to jump to different platforms?A good idea would be to simplify it down so it isn't really complicated. All you need is a ‘Level’ sprite and to use the ‘if touching <Level>’ block. I think the simplest way to do this is:
if <touching [Level v] ?> thenThis might not work and/or be really glitchy, but give it a try and mould your ideas around that
set x to (x position)
set y to (y position)
end

Hope that doesn't sound too confusing or weird
–Robinflight–
- --Robinflight--
-
Scratcher
40 posts
How do i make a "platformer"
Also, if it does work, be careful not to mix up the ‘go to’ motion block with the blocks I mentioned. This may not be a problem but it was for me…So how do I make it to where the sprite doesnt just phase through the platforms and actually stays on and able to jump to different platforms?A good idea would be to simplify it down so it isn't really complicated. All you need is a ‘Level’ sprite and to use the ‘if touching <Level>’ block. I think the simplest way to do this is:if <touching [Level v] ?> thenThis might not work and/or be really glitchy, but give it a try and mould your ideas around that
set x to (x position)
set y to (y position)
end
Hope that doesn't sound too confusing or weird
–Robinflight–
- NeonG4
-
Scratcher
1000+ posts
How do i make a "platformer"
snipHey @–Robinflight–,
If you set x to x position, that does next to nothing*. (Same goes with the set y to y position). If you aren't sure, run a test case.
say x position is 47, and the player is touching the level.
if <touching [level v] ?> then // check passed!we can see that it doesn't seem to change the position at all.
set x to (x position) // if xpos = 47, then we just set the x position to 47.
... // same for y
end
*The 2 blocks will delay the stack 1 frame, by about 0.03 seconds.
- --Robinflight--
-
Scratcher
40 posts
How do i make a "platformer"
Oh okay, never mind then
–Robinflight–
–Robinflight–
- drsmith86
-
Scratcher
9 posts
How do i make a "platformer"
hey just follow griffpatchs tutorial on how to make a platformer

- nebgenius
-
Scratcher
14 posts
How do i make a "platformer"
when green flag clicked
forever
change y by (-10
end
when green flag clicked
forever
if <touching ground> then
change y by (10)
when green flag clicked
forever
if <up arrow> then
change y by (20)
Last edited by nebgenius (Jan. 14, 2025 13:46:09)
- OriginalLion123
-
Scratcher
25 posts
How do i make a "platformer"
I tried doing something and it didn't work
- nebgenius
-
Scratcher
14 posts
How do i make a "platformer"
what is the dark red up arrow block from
it is this
<key [ up arrow] pressed?>
Last edited by nebgenius (Oct. 31, 2025 15:47:31)
- JamesTheCoder1234
-
Scratcher
5 posts
How do i make a "platformer"
You need:
A player,
A player hit box,
and a ground sprite.
and all the code down below
A player,
A player hit box,
and a ground sprite.
and all the code down below
Last edited by JamesTheCoder1234 (Dec. 7, 2025 10:01:34)
- year3klee
-
Scratcher
1 post
How do i make a "platformer"
Does anyone know how to code a scrolling platformer?
is it
is it (camera x)insaid of
change x by (10)
- nebgenius
-
Scratcher
14 posts
How do i make a "platformer"
Does anyone know how to code a scrolling platformer?is it
(camera x)insaid ofchange x by (10)
yes
- OriginalLion123
-
Scratcher
25 posts
How do i make a "platformer"
I will very much use thatDoes anyone know how to code a scrolling platformer?is it
(camera x)insaid ofchange x by (10)
yes
- Discussion Forums
- » Help with Scripts
-
» How do i make a "platformer"
