I know how the mechanics work now, if something is next to the object and you try to hit or push the object into it's direction (like a crate, enemy, wall, heart or the points ) then you swap, but if it is an enemy they attack, ex:
enemy not against anything
enemy against wall
hope this helps!