0
votes
0answers
16 views

Collision in Tiled Map - LibGDX

I have collision code that deals with left or right or top or bottom. I am using Tiled Map with LibGDX. Question is: How do I detect collision with other cells by all 4 sides, and not specifically ...
0
votes
0answers
29 views

Rendering bug in java

I'm using a simple rendering method in java to render tiles. Everything looks fine, but I notice that some rows grow 1 pixel when I move, and dhen shrink back, but I have no idea why. Infos: I'm ...
1
vote
2answers
35 views

(LibGDX) Changing Origin of Box2D World relative to TiledMap (or Vice Versa)

I'm playing around with Box2D and TiledMaps and I've come across this minor annoyance. As you can see, both Box2D and TiledMap render at the center of the screen. This forces me to compensate by ...
0
votes
1answer
92 views

Should I use tiles in a snake game? [closed]

I'm building a simple snake game, which is my first game ever. I'm using LibGDX, which is Java-based. I've looked at the Tiled Map Editor, but I don't know if it is necessary in a simple game like ...
-2
votes
2answers
229 views

Why can't I set a single value in a game map Java 2D array? [closed]

I'm trying to set one character on 2D array. map[0][2] = "0"; However, I'm getting 11011 11011 11011 11011 ... I was expecting 11011 11111 11111 11111 ... What am I doing wrong? another ...
0
votes
2answers
81 views

Algorithmic error in tile engine? [closed]

I'm toying with creating a tile-based 2D java game engine. I can render the "local" area without issues(I.E. deciding which local tiles to render). The problem came when I introduced floating point ...
1
vote
1answer
63 views

Get Tile Location On Screen (Java Slick and Tiled2D)

I want to create a rectangle around each tile that's blocked value = true. How can I find the X and Y (on screen) coords of the each individual Tile?
-1
votes
1answer
94 views

java tile based game :tile lag fix

hi I have a game where it reads a txt file and loads a map 0 represents air and 2 represents dirt I have a class for each tile as well as a tilemap I will show u my code. the problem is it lags like ...
-2
votes
1answer
45 views

Using an image instead of a colored rectangle

I recently watched a video on how to do tilemaps in java. He has the tiles as colored rectangles. I want them to be images. My code: public void draw(Graphics g){ for(int row = 0; row < ...
0
votes
2answers
133 views

How to get surrounding tiles in a tile array

I've created a tiled map that holds two layers, one for the tile type, and the other for whether it is solid or not. I plan on creating very big maps, and checking every tile seems like it would slow ...
2
votes
2answers
383 views

How would I implement procedurally generated tiles in libgdx?

I'm creating a simple top down Zelda-esque game in libgdx, and I want to implement tile-based dungeons that are procedurally generated, similar to this. Libgdx does have a class called TiledMap which ...
0
votes
0answers
38 views

Should tiles in a tile-based game draw themselves? [duplicate]

I'm a beginner in game programming, and I want to start with Java (in which I have a strong background I think) and LWJGL. I want to create tile-based games. Let's say I have an object named Tile, ...
0
votes
0answers
36 views

Generating tileable terrain using Perlin Noise [duplicate]

I'm having trouble figuring out the solution to this particular algorithm. I'm using the Perlin Noise implementation from: ...
1
vote
2answers
230 views

Full map image loading, vs individual tile loading

I want to make a isometric tile game in java, like a lot of strategy games out there. What is the best approach to loading the map for this game? Would it be better practice to load one single image ...
3
votes
1answer
182 views

Minimizing amount of comparisons for collisions?

In my 'Terraria' based game I am having lag issues. The cause of the lag is as follows: Every update loop through all the tiles in the world: If the rectangle that was passed as an arg intersects ...
-1
votes
1answer
280 views

Slick2D and TileD [closed]

I've been learning Java for a while, and with my aims of being a game developer later in life, I've came across Slick2D+lwjgl and following tutorials and making some little things. However; I don't ...
0
votes
1answer
642 views

Creating a BufferedImage with several smaller images?

I am making a 2D tile based game. The tiles render fine from a spritesheet and a text file. However, I am using a for loop to draw the map to the screen. When it refreshes, it slows down the loop, and ...
1
vote
1answer
1k views

How to render a tilemap efficiently? [duplicate]

I'm using this code to load a tiled map, composed of 1000x1000 32x32px tiles: map = new TmxMapLoader().load("levels/xyz.tmx"); camera = new OrthographicCamera(); camera.setToOrtho(false, ...
-2
votes
2answers
518 views

How can I draw a map that is stored in arrays [closed]

I have spent over 12 hours with no avail trying to successfully draw my map. The map is stored in an array called Tiles[]. Each value in Tiles can either be 4 numbers: Grass Stone Water Void (EMPTY ...
0
votes
1answer
86 views

Saving an arbitrary sized 2d array

I'm trying to create an arbitrary sized(but not infinite) 2d tilebased world. My question is, how do i save a world like this? My idea was to split up the tiles into bigger chunks and then save those ...
0
votes
1answer
510 views

Please help me with my 2D isometric tile picking [duplicate]

Possible Duplicate: How to convert mouse coordinates to isometric indexes? Okay, I apologise in advance if I make no sense here. Basically, I've got a simple application that takes in a ...
-3
votes
1answer
929 views

Slick2D TileD Map Editor Properties [closed]

So I used the following post to help me render my isometric map in Slick2D: Slick2D Isometric TiledMap Rendering Problem Big thanks and credit to arminb for the code supplied and for the fix to be ...
4
votes
2answers
772 views

Slick2D Isometric TiledMap Rendering Problem

I created a Tiled Map using the Tiled Map Editor. In the Editor it looks like this: Desired State In my java program it looks like this: Actual State My java code is: public class Game extends ...
2
votes
2answers
219 views

How to stack units in a tile based game?

I'm trying to make it so that no more than 5 units can be stacked on a tile. I have a Tile class that creates each tile's preferences. Should I store the units in an array or arraylist in this class?
2
votes
2answers
524 views

Collision checking problem on a Tiled map

I'm working on a pacman styled dungeon crawler, using the free oryx sprites. I've created the map using Tiled, separating the floor, walls and treasure in three different layers. After importing the ...
1
vote
1answer
270 views

Saving a list of points into a text file

I recently posted a question about this, but was not really sure where to go. I've gotten some progress, and have generated some simple noise here: http://pastie.org/5408655 That works well enough ...
1
vote
0answers
1k views

TileMapRenderer in libGDX not drawing anything

So I followed the tutorial on the libGDX wiki to draw Tiled maps but it doesn't seem to render anything. Here's how I setup my OrthographicCamera and load the map: camera = new ...
-1
votes
1answer
313 views

Get coordinates of arraylist

Here's my map class: public class map{ public static final int CLEAR = 0; public static final ArrayList<Integer> STONE = new ArrayList<Integer>(); public static final int GRASS = 2; ...
1
vote
3answers
575 views

(int) Math.floor(x / TILESIZE) or just (int) (x / TILESIZE)

I have a Array that stores my map data and my Tiles are 64X64. Sometimes I need to convert from pixels to units of tiles. So I was doing: int x int y public void myFunction() { getTile((int) ...
0
votes
2answers
2k views

Efficient way to render tile-based map in Java

Some time ago I posted here because I was having some memory issues with a game I'm working on. That has been pretty much solved thanks to some suggestions here, so I decided to come back with another ...
1
vote
2answers
1k views

Java: Tile-based Collision Detection with Rectangles

There are a few tile-based collision detection questions out there, but none seemed to suit my need. I guess I really would like to know why this method for collision detection isn't working. It ...
1
vote
3answers
557 views

Compressing 2D level data

So, I'm developing a 2D, tile based game and a map maker thingy - all in Java. The problem is that recently I've been having some memory issues when about 4 maps are loaded. Each one of these maps ...
-2
votes
1answer
214 views

Tile engine Texture not updating when numbers in array change

I draw my map from a txt file. I am using java with slick2d library. When I print the array the number changes in the array, but the texture doesn't change. public class Tiles { public Image[] tiles ...
0
votes
1answer
477 views

Java - Finding distance between player and tile in array

What is the best way performance wise to do this? When I click a tile I want it to get the distance and if I am close enough I can interact with the tile. One way would be to find the tile by doing ...
1
vote
1answer
2k views

Java - 2d Array Tile Map Collision

How would I go about making certain tiles in my array collide with my player? Like say I want every number 2 in the array to collide. I am reading my array from a txt file if that matters and I am ...
1
vote
3answers
408 views

For the handling of buildings on a tile-based strategy game, what aproach should I use?

On a tile-based game of the strategy genre, which allows the player to place buildings over the terrain tiles, there are multiple approaches that can be taken for handling such situation. The ones ...
1
vote
1answer
3k views

Drawing hexagonal grid on Android

I'm trying to draw a hexagon grid in my Android application. I don't want to reinvent the wheel here so I'm looking for some frameworks/libraries or just some basic ideas about how should one do this. ...
1
vote
2answers
439 views

How can I create tiles that scale to multiple resolutions?

I am trying to create a multiplayer version of the popular Flash game N in Java. However, I'm not sure how to create a tileset that will scale up. Are the tiles for N pre-drawn or are they defined ...
9
votes
5answers
591 views

Increasing the probability for similar tiles to generate next to each other

I'm working on a tile map system, which insofar looks like this (green is grass, air is white, stone is grey, and blue is water): It uses a simple random number generator so that there's a 45% ...
2
votes
1answer
663 views

Slick2D Tile Based 'Fog of War' Blurring Problem

I'm working on my first Java Game and I have run into a little problem I'm hoping to get some help with. I'm using Slick2D displaying a tile based map, and I'd like to know how I can created a ...
1
vote
1answer
297 views

How do I determine if a tile is a slope based on the tile image?

In my game, every tile is a 32x32 texture. All the slopes are a 0 - 45 degree angle. I would like to determine, at the time I load the tile, if the is sloped by examining its texture/bitmap data. How ...
3
votes
0answers
891 views

Collision Detection on floor tiles Isometric game

I am having a very hard to time figuring out a bug in my code. It should have taken me 20 minutes but instead I've been working on it for over 12 hours. I am writing a isometric tile based game where ...
1
vote
2answers
849 views

2d very large tile based game, zoom and pan considerations

what's a sensible way of implementing zoom and panning for my game? each tile is very large, 100,000 x 100,000 pixels, with some objects possibly being only a single pixel at maximum zoom (small ...
4
votes
1answer
2k views

Scrolling tile system

I know this is a common question, but I can't find an answer to it that isn't written using a huge game library sadly. I'm trying to write a scrollable tile system, which allows the user to move ...
13
votes
2answers
986 views

How do you handle uneven tiles while rendering a tile map?

Here is what I want to do with my tile map that I am unsure of. As you can see the top walls are way larger then the bottom and side ones (this is also an issue with my corners which are odd shapes ...
2
votes
3answers
1k views

Java tilemap not working, Think it has something to do with my image rendering

Hey can someone help me out, I've been trying to fix this for about 2 hours now, and I'm a noob when it comes to game programming and Java(only been reading and programming with it for a week now, ...
2
votes
2answers
894 views

Tile based map and collision; getting stuck

I'm trying to make my character move around a tile map with collisions. Everything works fine except for one thing. I show you a picture with the problem: http://i.stack.imgur.com/ZWI7x.jpg That is, ...
1
vote
2answers
443 views

Level Creating Help

I am making a little 2d overhead RPG type game just for fun. I have almost all the basic stuff set up, but I just need a little help on level creation. I can already make a level and place each tile ...
6
votes
2answers
2k views

Tiled based map collision detection problem

I'm working on a tile-based Mario clone. I have implemented the tile based collision method from the tutorial http://www.tonypa.pri.ee/tbw/tut05.html. This works all fine when walking and falling. ...
3
votes
1answer
357 views

More smaller maps among which player can travel

I am developing 2d game, where maps are tile based, small about 20x20 tiles and player can travel between a lot of maps (in my game rooms) like this. The maps are connected sometimes verticaly and ...