Very interesting, I am trying to make a collision, except it is difficult because the camera angle is above my sprites, as is to say, when you press the left arrow, you wont go left, you turn, and up you will move up and down you will move down. your game is a side view where when you press left or right, they wont rotate they will go that direction. Need help
Hi. I downloaded this, copied out code and made it do what I wanted when it collides, and then, it didn't pick up on collisions. I did everything you said, and your collision detection works on my PC, but mine doesn't. I'll tell you my code if you need it, as well as the sort of game and the OS. Please tell me what I'm doing wrong!
That's not actually very nice. The cats come with Scratch. "Delza" is trying to give a big impression with collision detection. Please try to give her a go.
My 10-year-old was asking how to have sprite detect when they collide. There are two parts to the answer.
The first part is to use the sensing block "touching (other sprite)", although you could also use "distance to (other sprite)"
The second part is when you want both sprites to detect the collision. The problem I encountered was that one sprite would detect the collision, turn and move away, before the other sprite sensed that they'd collided. This wouldn't be a problem in some circumstances, and I could have solved it by re-ordering when bouncing and moving happened, but instead I used the control block "broadcast (message)" to send a bounce message, then both sprites turn when they receive this message.
A simple example that I hope helps someone.
Comments
You need to be logged in to post comments
Add a Comment
Very interesting, I am trying to make a collision, except it is difficult because the camera angle is above my sprites, as is to say, when you press the left arrow, you wont go left, you turn, and up you will move up and down you will move down. your game is a side view where when you press left or right, they wont rotate they will go that direction. Need help
Very nice this will be good to my pong. Thanks
Thanks! It sounds really helpful (but I can't tell until I download it).
Hi. I downloaded this, copied out code and made it do what I wanted when it collides, and then, it didn't pick up on collisions. I did everything you said, and your collision detection works on my PC, but mine doesn't. I'll tell you my code if you need it, as well as the sort of game and the OS. Please tell me what I'm doing wrong!
I downloaded it & exported both cats. I import the cats in nearly every project!!! Thanks for the help!
That's not actually very nice. The cats come with Scratch. "Delza" is trying to give a big impression with collision detection. Please try to give her a go.