Collision with background sprite not working

I have a student who is trying to recreate a pac man game. She’s using a background maze sprite. I’ve been tinkering with it and can’t seem to make it work.

Link to the project or level:
What I expect to happen: when pac man hits the background sprite it should bounce off or not allow the pac man to continue through it.
What actually happens: pac man just continues through as though there were no background sprite
What I’ve tried: initially, the pac-man sprite did not appear when using if conditional pac touching background then pac collide background1. Once I removed the conditional entirely - then the sprite appears. I had to create a counter variable to get the conditional to work. I put it in a function named “collide.” Everything works until I put the function in the draw loop and then the pac man sprite disappears again. I currently have the collide call outside of the draw loop so that whomever reviews this can see how it is currently working. Is there a way to have pac man actually collide with a background sprite?


In my experience with my students, any kind of maze type game requires individual wall sprites for the collision to be detected. I searched via Google for GameLab PacMan and the few I looked at also had individual walls. It is a bit more work but the collisions should work if the student recreates the background as individual wall sprites.

Good luck!