Ignore edge collisions on Area2D?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By arnath

I’m trying to make a Snake game. I have created Area2D nodes for my snake and a piece of food but I’m having an issue where area_entered is fired when the edge of the snake touches the edge of the food. Is there a way to avoid this? To better illustrate, area_entered is fired when the snake reaches the point in the attached screenshot and I want some way to only count a full-on collision between the two.


:bust_in_silhouette: Reply From: jgodfrey

Is this a “grid-based” version of the game? That is, does the snake only move a full grid square at a time? If so, why not make the CollisionShape2D associated with the “parts” smaller than their associated sprites? That way, you wouldn’t detect a collision until you actually end up on the same grid square.