This is a students code and I can’t figure out what is causing the bug. Any help is much appreciated.
Link to the project or level: https://studio.code.org/projects/gamelab/wkk640QHsbEtiz4f5ZqhV7Z5aTOl1JVwMunNTPKHFYM
What I expect to happen: if enemy1 touches the cake, the enemy and score respond
What actually happens: getting a bug "Cannot read property ‘isTouching’ of undefined
What I’ve tried: deleting parts of the insides of the function, checked variables at the beginning