Moving through a tiled map

Hi,

I am puzzled why my I cannot get my tiles sliding 1 tile to the left on a basic tiledGround.

I followed this awesome tutorial: How to make tiled grounds in BabylonJS — Makina Corpus

See a clean sample of my current project here: https://www.babylonjs-playground.com/#866PVL#2

What I wish to accomplish is to

  • press a key ‘l’
  • all tile maps move 1 tile left
  • the right column of tiles is replaced with new map tiles

So far:

  • I can load my tiles.
  • I can shift tiles manually, changing the xTileBase in the code.
  • Pressing ‘l’ does update the xTileBase (tile number, see console output).
    … but the new tiles will not load.

It seems just a basic - but trivial - understanding of js. But what / how?

Eventually some multi layer project like this would be nice: osmbuildings [ dot] org
But First Things First :wink:

Hey and welcome!

I can’t remember who created the tilemap.
By anyhow let me have a look at your PG:)

And here we are:
https://www.babylonjs-playground.com/#866PVL#4

1 Like

Thank you!