Stay on path in a maze


#1

Hello, all.

I have several students who want to create a game that includes a maze. They are interested in having their sprites bounce off the walls of the maze sprite (a background image in all cases). isTouching won’t check for a color; it only finds overlap between sprites and groups. I’m not sure how they can code this into their games without having to make every wall of the maze into a sprite? Any ideas out there? Maybe I’m missing something simple.

Thanks,
Susan


#2

I’ve had a student make a maze and yes, we made a bunch of sprites that overlapped to make a maze. It wasn’t a great solution but it worked. Hopefully someone else will chime in with a better solution.


#3

At least it’s workable. Do you still have a link to the game so we could take a look? That would be helpful.

Also, I don’t know a ton about groups. Does anyone know if this would this be an instance where a group might work? Or does it treat the group like 1 large sprite and the collision zone would apply to them all?


#4

Hi Susan,
Each sprite in a group maintains its own collider “zone”. Here’s a quick example:


#5

Awesome! Thank you for info about groups and the example, Mike.