Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to make walls
- scritchscrutch
-
Scratcher
32 posts
How to make walls
Im stuck in how to make walls plszz helps-
Hi, for starters you can add walls as a sprite and code it something like:
when green flag clicked
forever
if <touching [walls v] ?> then
insert script here
end
end
- helloworldbyeworld
-
Scratcher
1000+ posts
How to make walls
Do you mean a collision detecting script? If so, make a sprite that contains all the walls, then insert this script:
when green flag clicked
forever
point in direction (direction of movement::grey)
if <move?::grey> then
move (1) steps
end
if <<touching [walls v] ?> and <move?::grey>> then // this undoes the movement if it's touching the walls
move (-1) steps
end
end
Last edited by helloworldbyeworld (Oct. 24, 2021 20:37:22)
- AlphaNinjaBoss
-
Scratcher
4 posts
How to make walls
Thank you guys for ur help but the problem is I used to be really good at coding scratch blocks but than I stopped for 2 years or so and i forgot most of the stuff. So if u guys could just be a little more specific ( like when scritchscrutch made the insert script here block it kinda leaves me hanging and hellobyeworld I can't understand what those gray blocks are at first I thot they were variables but i don't think the “move?” boolean is a variable) so thx but just be a little more specific plzz
- bluedragon8633
-
Scratcher
1000+ posts
How to make walls
Thank you guys for ur help but the problem is I used to be really good at coding scratch blocks but than I stopped for 2 years or so and i forgot most of the stuff. So if u guys could just be a little more specific ( like when scritchscrutch made the insert script here block it kinda leaves me hanging and hellobyeworld I can't understand what those gray blocks are at first I thot they were variables but i don't think the “move?” boolean is a variable) so thx but just be a little more specific plzzFirst, make sure to never spell “thought” as “thot”. There might be a filter for it somewhere.![]()
Scritchscrutch's “insert script here” is where you should put in reactions to the walls. For example, collision or saying “ouch” or whatever.
The gray blocks are the Forums' built-in way of saying “insert script here”.
There are no move booleans anywhere in Scratch; they are action blocks.
(variable) //variable blocks are orange
move (5) steps //blocks that perform actions are basically rectangular
<<> and <>> //booleans are hexagonal.
- AlphaNinjaBoss
-
Scratcher
4 posts
How to make walls
I found a script that worked better for me bet thx all for your help
here is the project that i used it in
https://scratch.mit.edu/projects/592796564/
here is the project that i used it in
https://scratch.mit.edu/projects/592796564/
- bluedragon8633
-
Scratcher
1000+ posts
How to make walls
While it does work, it would be more efficient to add the <touching end wall?> code inside <key right arrow pressed?>. It uses fewer blocks and keeps things within a central loop (generally a good idea, especially for larger projects.)
On a side note, where did you get your platforming code? It's very simple, and is still fully functional.
On a side note, where did you get your platforming code? It's very simple, and is still fully functional.
- Potatomooseofgod
-
Scratcher
8 posts
How to make walls
New Game Coming Out Soon Called Dodgeball For Gamers This Really Helped Me With Some Code
- tidelgl
-
Scratcher
100+ posts
How to make walls
Please Play My Game When It Comes Out
looking forward to your new game, carry on

- Sussybaka4536356
-
Scratcher
5 posts
How to make walls
is my profile! also, I am making a maze game, what is the collision detector for walls in 2D maze Games? 
Is it the same as platformer games?
please play it when it comes outLast edited by Sussybaka4536356 (Nov. 20, 2025 17:38:44)
- cube_guyidk
-
Scratcher
3 posts
How to make walls
<[] < []>
move () steps
move () steps
move () steps
move () steps
move () steps
move () steps
move () steps
move () steps
move () steps
move () steps
move () steps
move () steps
move () steps
move () steps
move () steps
play sound [ v] until done
play sound [ v] until done
play sound [ v] until done
ask [Do you hate potateos] and wait
- Discussion Forums
- » Help with Scripts
-
» How to make walls













