First question here, so bare with me if I make a mistake or two. Long story short I'm currently developing a side scroller game in java with libgdx, which uses tiledmaps from the tiledmap creator software. When the player has run for some time the map is automaticly changed to a new one, using some code which looks similar to this:
void changeMap() { Gdx.app.postRunnable(() -> { testMap = new TmxMapLoader().load("someMap.tmx"); renderer.getMap().dispose(); renderer.setMap(testMap); }); }
My problem is that the map is changed instantly with no smooth transition at all, like one sec the player is on the old map, the next he starts instantly on the new one, which is quilte unprofessional in My opinion. I would like to create some smooth transition between the two. Maybe just a simple fade in, fade out. Any thing is Better than how it is now.
I have searched google, tried different "solutions" using the tween engine, tried Making a transition screen which first fades in over the playscreen, but when i try to fade back the playscreen is just stoppede etc. I'm really emptied for ideas, so it would be awesome if one of you experts could point me in the right direction. Or maybe Come up with a simple solution. I am experienced with java so any idea here will be apriciated.
This is written from a phone, so sorry for any spelling mistakes.