Err, hi. Sorry for another topic, but im really lost, and i cant move foward.
I researched many wiki, youtube…
I saw many deprecated stuff, and i was able to finnally draw that .tmx thing :D;
But, i have some questions, i was wondering if any can help me, i already researched and researched and researched and found nothing, nothing at all.
Ok, the question is, supposing that i have a plane in that position, how can i check for collisions near him?
I mean, how can i get all x,y tile positions?
I tried some methods, but i got nothing, all i got was some hexadecimal memory stuff, or i found the id,which doesnt help much ?
Anyway, all i need to know is how to get the X,Y positions of the tiles, must be really really simple/ Obvious, because i just cant find any info related.
Do i need to create properties at the program to get x,y ? idk
obs, im using “TILED” program.
public class AlphaColourLibgdx implements ApplicationListener {
private SpriteBatch batch;
private Texture plane;
private Sprite planeSprite;
private int xplane, yplane;
private TiledMap map;
private OrthographicCamera camera;
private MapRenderer mr;
@Override
public void create() {
batch = new SpriteBatch();
plane = new Texture(Gdx.files.internal("plane.jpg"));
planeSprite = new Sprite(plane);
xplane = 270;
yplane = 610;
map = new TmxMapLoader().load("GrassLevel2.tmx");
//Check/Positions of 1 Tile!
TiledMapTileSet tileSet = map.getTileSets().getTileSet("Grass");
System.out.println(tileSet.getTile(1));
//
mr = new OrthogonalTiledMapRenderer(map);
camera = new OrthographicCamera(512, 512);
camera.position.x = 270;
camera.position.y = 10;
camera.update();
}
@Override
public void render() {
GL10 gl = Gdx.gl10;
gl.glClearColor(1, 1, 1, 1);
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
mr.setView(camera);
mr.render();
batch.begin();
planeSprite.setPosition(xplane, yplane);
planeSprite.draw(batch, 1);
batch.flush();
batch.end();
}