Discuss Scratch

kasaneteto1457
Scratcher
9 posts

How do you make kill walls?

Im having trouble with the code and I can't figure it out can someone help?
Catscratcher07
Scratcher
1000+ posts

How do you make kill walls?

Please link your project and show us your attempt at making them yourself. Both “kill” and “wall” are very dependent on your project.
UncappedCyanMarker
Scratcher
26 posts

How do you make kill walls?

well, seeing that you asked “how to make kill walls?”, its pretty easy. put this script somewhere in the player's code:
forever
if <touching [wall v] ?> then
broadcast [game over v]
end
end
or, if you want the player to have lives, use this:
forever
if <touching [wall v] ?> then
change [lives v] by (-1)
end
if <(lives) = [0]> then
broadcast [game over v]
end
end

hope this helps!

Last edited by UncappedCyanMarker (Oct. 8, 2026 22:31:11)

badfinancialchoices
Scratcher
26 posts

How do you make kill walls?

It is simple, but I contain your troubles

when green flag clicked
forever
if <touching [wall v]> then
broadcast [ game over v]

end
end
when I receive [ game over v]
delete this clone
when green flag clicked
Create clone of [ me v]

Hope this helped.
kasaneteto1457
Scratcher
9 posts

How do you make kill walls?

I don't think it's working, did I do the code wrong?

when green flag clicked
forever
if <touching [kill wall] ?> then
broadcast [game over]

end
end

when I receive [game over]
delete this clone

when green flag clicked
create clone of [myself]
Catscratcher07
Scratcher
1000+ posts

How do you make kill walls?

kasaneteto1457 wrote:

I don't think it's working, did I do the code wrong?

when green flag clicked
forever
if <touching [kill wall] ?> then
broadcast [game over]

end
end

when I receive [game over]
delete this clone

when green flag clicked
create clone of [myself]
This script assumes your player sprite immediately creates a clone that would serve as the player and doesn't do much else with the main sprite, which is not normal. Please link your project so we can come up with a solution that will actually make since for your project.
UncappedCyanMarker
Scratcher
26 posts

How do you make kill walls?

the clone blocks are unnecessary

Last edited by UncappedCyanMarker (Oct. 10, 2026 03:35:24)

kasaneteto1457
Scratcher
9 posts

How do you make kill walls?

This is my attempt at making kill walls: https://scratch.mit.edu/projects/1389632651/
UncappedCyanMarker
Scratcher
26 posts

How do you make kill walls?

By the way, if nothing else is going to happen when you touch a kill wall, then use this script:

forever
if <touching [kill wall v] ?> then
stop [all v]
end
end

the “game over” message is just for if you want something to happen when you touch a kill wall (aside from dying, of course.) if nothing happens, then just stop the project.

Last edited by UncappedCyanMarker (Yesterday 04:01:29)

GreenSqu1d_Minecraft
Scratcher
43 posts

How do you make kill walls?

UncappedCyanMarker wrote:

well, seeing that you asked “how to make kill walls?”, its pretty easy. put this script somewhere in the player's code:
forever
if <touching [wall v] ?> then
broadcast [game over v]
end
end
or, if you want the player to have lives, use this:
forever
if <touching [wall v] ?> then
change [lives v] by (-1)
end
if <(lives) = [0]> then
broadcast [game over v]
end
end

hope this helps!
off topic but we have similer scratch block jokes
GreenSqu1d_Minecraft
Scratcher
43 posts

How do you make kill walls?

Catscratcher07 wrote:

kasaneteto1457 wrote:

I don't think it's working, did I do the code wrong?

when green flag clicked
forever
if <touching [kill wall] ?> then
broadcast [game over]

end
end

when I receive [game over]
delete this clone

when green flag clicked
create clone of [myself]
This script assumes your player sprite immediately creates a clone that would serve as the player and doesn't do much else with the main sprite, which is not normal. Please link your project so we can come up with a solution that will actually make since for your project.
the issue is the sprite probably doesnt move from the killwall, so they need to add a move to center code
World_Aircraft
Scratcher
6 posts

How do you make kill walls?

Just create your wall, and put this in the player sprite:
when green flag clicked
forever
if <touching [your-wall v] ?> then
put your death/kill script here
end
end
FrenchFriesDev
Scratcher
43 posts

How do you make kill walls?

when I receive [Gameover v]
stop [All v]

Save you time
kasaneteto1457
Scratcher
9 posts

How do you make kill walls?

I would like to make the player move back to the start of the project. (where the player sprite is when you begin the project)
UncappedCyanMarker
Scratcher
26 posts

How do you make kill walls?

in that case:

when green flag clicked
go to x: (0) y: (0)
forever
if <touching [kill wall v] ?> then
go to x: (0) y: (0)
end
end

( change the x and the y to the starting position)
kasaneteto1457
Scratcher
9 posts

How do you make kill walls?

UncappedCyanMarker wrote:

in that case:

when green flag clicked
go to x: (0) y: (0)
forever
if <touching [kill wall v] ?> then
go to x: (0) y: (0)
end
end

( change the x and the y to the starting position)

Thank you!

Powered by DjangoBB