sfml-tmxloader icon indicating copy to clipboard operation
sfml-tmxloader copied to clipboard

MapObject::Move is incorrect

Open fallahn opened this issue 9 years ago • 3 comments

moving the points as well as the centre point adds up to double the movement (the points are supposed to be relative)

fallahn avatar Oct 19 '14 16:10 fallahn

A potential fix for this has been pushed to the 'next' branch.

fallahn avatar Apr 02 '16 12:04 fallahn

Using the 'next' branch, I still have issues with both MapObject::move() and MapObject::setPosition(). See this video for demonstration

Is there a workaround for this?

astewartau avatar Oct 12 '16 05:10 astewartau

The best approach in this case would probably be to separate the map parsing from the entity building/image rendering as much as possible. This is a lessoned I learned when implementing a tmx parser (which supports much newer revisions of the format) for my game engine project. It might be best to use the map loader to parse the iniital map object data, such as size, position, type etc. and then use that data to create your own custom transformable entity, tailored to your game. If using the map loader seems a bit convoluted for this, then the linked code should be extractable with a little work (mainly to remove engine specific factory functions), and can be used to parse map data from xml to a series of structs/arrays which mirror the data layout of a tmx map. Then this data can be used as needed to develop your own entities, drawables and so on.

fallahn avatar Oct 12 '16 08:10 fallahn