Hi, I am trying to detect collision between a snake(Rectangleshape) and an apple(Sprite).
The function that needs to detect collision is marked red as shown in the screenshot. It's not working at all. The problem is that when I write the same if statement that detects collision in the main function, it works fine. But when it's implemented in a class it doesn't work. I think my problem is referencing a class member which is from another class. Can you help..?
"snake" is the object for mySnake class.
"yilan" is the RectangleShape referance.
"sprite" is the sprite for Elma class.screenshots:https://www.hizliresim.com/du53hc8https://www.hizliresim.com/hqk5seshttps://www.hizliresim.com/2szihm5