Show Picture moving with Tiled

Hi

when i move my tiles my boat doesnt move with the tiles

how can i move my boat1.png when i move my map around screen

or how can i stick the boat1.png so it moves only with the tile is it placed on,

i am using tiled to make the map

please help

Hey akhtarx,

I haven’t downloaded your project, so all I’m sugesting here are general advices.

There are two approaches on this topic, depending on how you move your tiles around.

  1. All the tiles are inside one or several display group and you move around these group(s) to move the tiles. This is the more common way of doing it. Now you have to options, frist: insert your boat.png in one of the tile groups, so it will move with them, second: move the boat by the amount of pixels that you are moving the tiles.

  2. The tiles are moved around by looping through them and moving them one by one. This is used sometimes due to performance optimization. Here are two options as well, first: move the boat by the amount of pixels that you are moving the tiles, second: check for the position of the tile the boat is standing on (e.g. boat is on tile 4/7, so you get that tiles position and use it for the boat).

I hope this more general view helps you to find a solution.

Hey akhtarx,

I haven’t downloaded your project, so all I’m sugesting here are general advices.

There are two approaches on this topic, depending on how you move your tiles around.

  1. All the tiles are inside one or several display group and you move around these group(s) to move the tiles. This is the more common way of doing it. Now you have to options, frist: insert your boat.png in one of the tile groups, so it will move with them, second: move the boat by the amount of pixels that you are moving the tiles.

  2. The tiles are moved around by looping through them and moving them one by one. This is used sometimes due to performance optimization. Here are two options as well, first: move the boat by the amount of pixels that you are moving the tiles, second: check for the position of the tile the boat is standing on (e.g. boat is on tile 4/7, so you get that tiles position and use it for the boat).

I hope this more general view helps you to find a solution.