I’m learning how to package game objects into classes. I have a fish game object that has a sort of ‘event handler’ tied to an overlap when it collides with a player game object. When I was refactoring, I decided to take this functionality and put it in the constructor. I am getting an error that I can’t shake! The error is on Fish:22, and GameScene:32.
The error message is odd but I think the problem is using this as a function parameter. this is a keyword and can’t be assigned to. Likely you want something like