Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do I make my snake die when touching itself
- LAMAR__44
-
2 posts
How do I make my snake die when touching itself
I'm trying to make my snake die when it touches itself. Can anyone help? Here's my project by the way https://scratch.mit.edu/projects/239544972/
- deck26
-
1000+ posts
How do I make my snake die when touching itself
No need to set the direction to the current direction when a key press is doing nothing - just use if not direction = value instead of using if/then/else.
If you're going to use clones for this you can't really use touching sprite for detecting when you hit another part of the snake. So it starts getting more complicated. One option would be to move another sprite first to see if it you'll end up touching the snake.
Personally I much prefer a grid system for this kind of game - see my projects
https://scratch.mit.edu/projects/42045208/
https://scratch.mit.edu/projects/47154008/
https://scratch.mit.edu/projects/47150778/
If you're going to use clones for this you can't really use touching sprite for detecting when you hit another part of the snake. So it starts getting more complicated. One option would be to move another sprite first to see if it you'll end up touching the snake.
Personally I much prefer a grid system for this kind of game - see my projects
https://scratch.mit.edu/projects/42045208/
https://scratch.mit.edu/projects/47154008/
https://scratch.mit.edu/projects/47150778/
Last edited by deck26 (Aug. 19, 2018 12:51:20)
- LAMAR__44
-
2 posts
How do I make my snake die when touching itself
Thanks, this helped me out a lot!
- s246054
-
3 posts
How do I make my snake die when touching itself
but how can you make it get game over with with clones
- Wyan100
-
1000+ posts
How do I make my snake die when touching itself
but how can you make it get game over with with clones
Mabe you should make a new topic instead of asking on one that's 2 years old.
- It5MeCohen
-
2 posts
How do I make my snake die when touching itself
Easy, use broadcasting, then make it so that you somehow die, but then it will broadcast a message, then you can create a death screen sprite, then make the screen recieve the message, then appear but how can you make it get game over with with clones
- Dharshan20
-
4 posts
How do I make my snake die when touching itself
yeh i made a snake game and i couldn't figure out how to make it die when it touches itself either??
- CheckPasswrd
-
7 posts
How do I make my snake die when touching itself
bru ik im 3 years late but i still cant make it die I used clones and I cant make it die pls help
- deck26
-
1000+ posts
How do I make my snake die when touching itself
So create your own new topic and share the project please. bru ik im 3 years late but i still cant make it die I used clones and I cant make it die pls help
- willma02496
-
1 post
How do I make my snake die when touching itself
i know im 4 years late but i cant figure it out either
- YeeterTheCreeter22
-
30 posts
How do I make my snake die when touching itself
Try doing something like this:
Last edited by YeeterTheCreeter22 (March 1, 2022 19:25:15)
- Jereb-co7
-
100+ posts
How do I make my snake die when touching itself
do not necropost Try doing something like this:
- Discussion Forums
- » Help with Scripts
-
» How do I make my snake die when touching itself