My game has a drog and drop function where an Object sprite can be droped on a Document sprite. Document sprite can have many zones. Object changes appearance (ie changes frame) dependong on the zone it is dropped on.
I have made a system where the Document has 2 images point (0 and 1). When Object is dropped on Document, I check the distance between the Object sprite coordinates and the Document imagepoint.
I have many objects and many documents so I put all of them in families Objets and Documents.
My code is :
+ System: distance(Objets.X,Objets.Y,Documents.ImagePointX(1),Documents.ImagePointY(1)) < 100
-> Objets: Set animation frame to 1
+ System: Else
-> Objets: Set animation frame to 0
So I'm testing proximity to Imagepoint 1
My code works when a Document has ImagePoint 0 and 1.
Some documents have no Imagepoint 1, only Imagepoint 0, and my code behaves like if Imagepoint 0 was Imagepoint 1.
Is it Constructs that uses Immagepoint 0 if there is no ImagePoint 1 or something I did wrong ?