Tag Info

Hot answers tagged

2

Your algorithm only looks at the diagonals: final int[] axs = new int[] { -1, 1 }; final int[] ays = new int[] { -1, 1 }; ... for(final int ax : axs) { for(final int ay : ays) { final int x = current.x + ax; final int y = current.y + ay; You need to also check the orthogonal tiles: (x+0, y+1), (x+1, y+0), (x+0, y-1), (x-1, y+0). In ...


1

After much frustration, I found out that I had made a folder the same name with the text file by mistake!! After deleting the folder all works fine, thank you for replying!


1

This is most likely a rounding error. I'm guessing that x and y are ints. Keeping track of the x and y values as floats, I expect will fix the issue. Consider if the values are being floored: Moving Left 10 - 1.6 = 8 Moving Right 10 + 1.6 = 11


1

One way of doing this is creating and loading an image into memory that is as large as the background. However, this seems like a horrible waste of memory. To affect the whole screen with a fragment shader you don't need a full-screen texture, just a full-screen polygon (one quad or two triangles). The four vertices would have attributes on them. At the ...


1

If you are just filling with a solid color then you could pass that color to the fragment shader as a uniform, and process it from there. Use a full screen quad for the fragment shader to render onto. Another way is to this to render the background to an FBO and do the full screen quad trick but apply the FBO texture to it. This would be very memory ...



Only top voted, non community-wiki answers of a minimum length are eligible