# move multiple object on isometric map

**URL:** <https://forums.solar2d.com/t/move-multiple-object-on-isometric-map/325685>\
**Category:** Million Tile Engine\
**Created:** [May 21, 2014, 1:00pm UTC](https://forums.solar2d.com/t/move-multiple-object-on-isometric-map/325685 "2014-05-21T13:00:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RJ5](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/r/8e8cbc/32.png) [@RJ5](https://forums.solar2d.com/u/RJ5)\
**Post date:** [May 21, 2014, 1:00pm UTC](https://forums.solar2d.com/t/move-multiple-object-on-isometric-map/325685/1 "2014-05-21T13:00:46Z")

</div>

is it possible to move multiple objects within an isometric map without defining them as sprites?

so for example I have a 4x4 wall (built out of 16 tiles), when a certain condition is true I want all of the tiles to move to new locations

as far as I can see there is no mte.moveSpriteTo() which is for non sprite layers, am I wrong in thinking this?

if so is there another way I can move these tiles?

I know the start and end locX/Y of each tile, but just dont know how to transition between them

any help would be appreciated

---

<div class="post-metadata">

**Author:** ![dyson122](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/d/9fc348/32.png) [@dyson122](https://forums.solar2d.com/u/dyson122)\
**Post date:** [May 22, 2014, 8:11pm UTC](https://forums.solar2d.com/t/move-multiple-object-on-isometric-map/325685/2 "2014-05-22T20:11:49Z")

</div>

Tiles are generally meant to be static objects that remain fixed at their map location. What you can do is spawn a sprite from the tile, remove the tile, and move the resulting sprite to your new position. For example:

```
local tile = mte.getTileObj(startLocX, startLocY, tileLayer) local tileSprite = tile:makeSprite() mte.changeSpriteLayer(tileSprite, tileLayer + 1) mte.updateTile({locX = startLocX, locY = startLocY, layer = tileLayer, tile = 0}) mte.moveSpriteTo({sprite = tileSprite, locX = endLocX, locY = endLocY, time = 1000})

```

It is also technically possible to move a tile object by directly manipulating it’s x any y properties as you would any other displayObject, if you really have to do so. This example assumes you’re still using an isometric map:

```
local tile = mte.getTileObj(startLocX, startLocY, tileLayer) --Insert into a higher layer so it doesn't move beneath the other tiles local layerObj = mte.getLayerObj({layer = tileLayer + 1}) layerObj:insert(tile) --Calculate the true destination coordinates local endPosX, endPosY = mte.locToLevelPos(endLocX, endLocY) local endPos = mte.isoTransform2(endPosX, endPosY) --Move the tile, then update the new tile location with the index of the old tile --and remove the old tile. local destroy = function(event) mte.updateTile({locX = endLocX, locY = endLocY, layer = tileLayer, tile = tile.index}) mte.updateTile({locX = startLocX, locY = startLocY, layer = tileLayer, tile = 0}) end transition.to(tile, {time = 1000, x = endPos[1], y = endPos[2], onComplete = destroy})
```

---

<div class="post-metadata">

**Author:** ![dyson122](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/d/9fc348/32.png) [@dyson122](https://forums.solar2d.com/u/dyson122)\
**Post date:** [May 22, 2014, 8:11pm UTC](https://forums.solar2d.com/t/move-multiple-object-on-isometric-map/325685/3 "2014-05-22T20:11:49Z")

</div>

Tiles are generally meant to be static objects that remain fixed at their map location. What you can do is spawn a sprite from the tile, remove the tile, and move the resulting sprite to your new position. For example:

```
local tile = mte.getTileObj(startLocX, startLocY, tileLayer) local tileSprite = tile:makeSprite() mte.changeSpriteLayer(tileSprite, tileLayer + 1) mte.updateTile({locX = startLocX, locY = startLocY, layer = tileLayer, tile = 0}) mte.moveSpriteTo({sprite = tileSprite, locX = endLocX, locY = endLocY, time = 1000})

```

It is also technically possible to move a tile object by directly manipulating it’s x any y properties as you would any other displayObject, if you really have to do so. This example assumes you’re still using an isometric map:

```
local tile = mte.getTileObj(startLocX, startLocY, tileLayer) --Insert into a higher layer so it doesn't move beneath the other tiles local layerObj = mte.getLayerObj({layer = tileLayer + 1}) layerObj:insert(tile) --Calculate the true destination coordinates local endPosX, endPosY = mte.locToLevelPos(endLocX, endLocY) local endPos = mte.isoTransform2(endPosX, endPosY) --Move the tile, then update the new tile location with the index of the old tile --and remove the old tile. local destroy = function(event) mte.updateTile({locX = endLocX, locY = endLocY, layer = tileLayer, tile = tile.index}) mte.updateTile({locX = startLocX, locY = startLocY, layer = tileLayer, tile = 0}) end transition.to(tile, {time = 1000, x = endPos[1], y = endPos[2], onComplete = destroy})
```

---

<div class="post-metadata">

**Author:** ![udaynayak88](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/u/7cd45c/32.png) [@udaynayak88](https://forums.solar2d.com/u/udaynayak88)\
**Post date:** [September 5, 2014, 7:08am UTC](https://forums.solar2d.com/t/move-multiple-object-on-isometric-map/325685/4 "2014-09-05T07:08:51Z")

</div>

if i have one tree object on 4 tile and different layer, so how can select it from map ? &nbsp;&nbsp;

---

<div class="post-metadata">

**Author:** ![udaynayak88](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/u/7cd45c/32.png) [@udaynayak88](https://forums.solar2d.com/u/udaynayak88)\
**Post date:** [September 5, 2014, 7:08am UTC](https://forums.solar2d.com/t/move-multiple-object-on-isometric-map/325685/5 "2014-09-05T07:08:51Z")

</div>

if i have one tree object on 4 tile and different layer, so how can select it from map ? &nbsp;&nbsp;
