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: https://studio.code.org/projects/gamelab/bOemlf0rine7dBazvNsV2RxdxZxh0oJ86BxLUIY7jZI
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?