I am working to develop a drag and drop game. The user click and drags the object between the coutry name to the correct flag. A line is drawn on the screen connecting the two points.
I got the line to draw but I am struggling to position it correctly. I would appreciate any insights into what I am doing wrong. This is my first gdevelop project.
I am using the x,y positions in document-properties and those on the scene editor but these don’t give the results I expect. I am using point is in collision with FranceFlag draw from FranceText.X(), FranceText.Y() to FranceFlag.X(),FranceFlag.Y() with line. I have also tried using the exact x/y coordinates.
@ErmesBertone, The easiest is to use a ShapePainter object. Going by the explanation given by the OP, it sounds like they were using this and needed to either uncheck the “Draw shape relative to the object position o the screen”, or place the ShapePainter at the origin.
Otherwise the ShapePainter object uses the position difference between it and the origin, and applies that as an offset to the line.
Yeah, GDevelop makes it so much easier. I grew up with an Amstrad, programming Z80 assembler. and you appreciate the work that games engines, like GDevelop, do under the hood, leaving devs more time to focus on other game aspects (gameplay, gfx and vfx for example).