You can write add on to a list of numbers by using
stringBuilder.append(", ").append(number); |
or just
stringBuilder.append(number); |
if it's the first number in the list.
You typed
instead of
.
The problem is most likely caused by how you calculate your tile positions in combination with float rounding.
For example, mathematically equal multiplications and additions might not equal the exact same value. For example
might not give the exact same result as
The reason why I took this exact example is because that's most likely what you're doing for your sprite positions (or what LibGDX does). Consider a tile, it goes from
to
x2 = tileX * tileSize + tileSize; |
However, the tile next to it at index tileX+1 will start at
x1 = (tileX + 1) * tileSize; |
Now there's a chance for those two to be different since
tileX * tileSize + tileSize |
may not be equal to
Rounding the values therefore eliminates the problem, but is not a very elegant solution. =S
System.out.println("Only because you asked so kindly."); |
