LibGDX & Tiled is stressing me out!

Ahoy!

So this past week I tried welcoming myself to the wonderful and stressful worlds of using Tiled with LibGDX. I understand visually displaying the maps and moving around them, but collision and animation, as well as player/enemy placement has me stressed out and depressed! I NEED ASSISTANCE!

Here is what I just don’t understand:
• How to animate certain tiles. Like, a waterfall, for example.
• How to properly and quickly detect collision between an object and a tile.

  • Seriously, I could use some pastebins for this one. I’ve seen many tutorials and other guides but they don’t really explain it. I understand the basics. Have player, detect direction, check tile beside it. But how do I use this? Please provide some code for an example. This one is causing me to not make anything at the moment, which is boring.
    • How to get coordinates of a tile and place an object at the location.

Thank you so much. Please help out in any way. I’m stressing over this and it is driving me crazy.

  • A

That is an interesting method. I am looking for the more common way to do it. I am actually quite surprised due to the lack of examples using tiled and libgdx. Is it not common? :o

I followed dermetfans YouTube-tutorials when i fiddled with libgdx and tiled, now i don’t touch tiled anymore due to doing the maps procedurally instead.

Here his collision tutorial:

And the code:
https://bitbucket.org/dermetfan/tiledmapgame/src/382e8070f991c93bb2582cd54a6636d3901d2758/TiledMapGame/src/net/dermetfan/tiledMapGame/entities/Player.java?at=default

And yes, there aren’t much documentation, from the developers. They are usually busy developing, everything to use the library is in it. This isn’t just libgdx and whatever, but true for unity and others, they usually give only the basics and then you have to learn on your own or from others who have learned themselves.

What would you recommend as the alternative from Tiled?

I started working with making the maps procedurally, random, instead of having to manually make them, will suit my rts game more.
If you wanna give that a go look up some texts about Perlin Noise, Simplex Noise, Diamond Square(This one gave me the nicest result).

Here are some bookmarks i kept from jgo about that stuff:
http://www.java-gaming.org/index.php?topic=30281.0

Some other:


This thing is pretty awesome:
http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/
Gonna give that a try some day just for the heck of it.

Well, procedural generation is all the hype nowadays so you shouldn’t have any problems finding tutorials for it.

I have actually heard about the random generation from many developers, but have been too afraid to dive into it. Is this possible or recommended for something like a platformer as well?

For platformer you could use those methods to make some landscapes, ups and downs and such. To make a mario out of it would be hard, you need to tackle the random generation with different methods, like creating parts and then randomly fitting them together. Atleast that’s what i would think, never done or thought of doing any platformer though.

I see. I know that orange pixel uses this method of generation for their games, like the recent Gun Slugs 2 project. I am really fascinated with terrain generation right now. I never thought I would be brave enough to tackle it. lol

You should stop and think if you really need it though, with procedural generation you won’t get the same detail, I for one would want more detail in a platformer. Do you need procedural generation? Or does it just sound hip?