Posted February 05, 2023 by d w roberts
#train #spline
This is still ugly and there isn't enough information to interpolate the carriages turning quite right yet (so they look a little odd as they turn corners) - but finally have a little train running about on a Tiled map.
What is nice about this is that the track location is determined solely from the tileset and no additional editing. It doesn't tolerate junctions yet (which is why the train only travels a little segment) but it can detect and create a path for all connected track segments in the level.
I now need to decide whether to tune the carriage turning and the spline, or hurry up and give the player some degree of control over the train...