Dynamic tiled map with animation

Anything libgdx related goes here!

Dynamic tiled map with animation

Postby meatface » Wed Apr 11, 2012 10:26 pm

Hi,

I'm making a tile based game that will require certain tiles to be animated, and I may also need the ability to add/remove tiles. From what I understand this isn't possible with the included tiled library, is there a way I can get it to work with TiledMapRenderer without too much work?

If not, and I need to write a new tile engine with animation, am I best not using a camera and re-drawing the viewable area each frame? Or should I perhaps draw the entire static portion of the map (most of it) using TiledMapRenderer, then see if any animated tiles are in view, and if so draw over that tile accordingly?

Thanks.
meatface
 
Posts: 4
Joined: Wed Apr 11, 2012 10:18 pm

Re: Dynamic tiled map with animation

Postby BurningHand » Wed Apr 11, 2012 11:39 pm

I've got something I can share that might serve as a starting point. Next time I'm at a PC I will get it in order and uploaded.
IRC: nexsoftware / mobidevelop; GitHub: MobiDevelop;
BurningHand
 
Posts: 2459
Joined: Mon Oct 25, 2010 4:35 am

Re: Dynamic tiled map with animation

Postby just4phil » Thu Apr 12, 2012 11:48 am

i use additional objectLayers in Tiledmapeditor and parse them as GameObjects (with box2d-bodies and -fixtures) out of the TMX file.
Then i render animations on these GameObjects.
CollisionDetection comes from box2d.

so i have control over evrything from out of the tiledmapeditor.

dont know if thats a good way for doing this... just my best guess! ... and it works!

best regards
phil
just4phil
 
Posts: 831
Joined: Fri Feb 03, 2012 10:07 pm
Location: Berlin

Re: Dynamic tiled map with animation

Postby meatface » Fri Apr 13, 2012 11:40 am

I think I'm just going to render the static portion of the map using the TileMapRenderer, and use placeholder tiles for any that require animation and just draw them if they're in the viewport.
meatface
 
Posts: 4
Joined: Wed Apr 11, 2012 10:18 pm


Return to Libgdx

Who is online

Users browsing this forum: Bing [Bot], hkahleong, Lomelin, tubus and 8 guests