Im making a platform game for the learning experience, and im having a problem.
The tiles are overlapping eachother by one pixel. Or at least that's what i think is happening. The result is a gray line between tiles and my coordinates are thrown further and further off as the player goes right.
I'm also making a side scroller with SFML, I think you are setting the tile position wrong. Try something like tiles[mapTileX][mapTileY].sprite.SetPosition(mapTileX*TILESIZE,mapTileY*TILESIZE);
No that doesn't work. I'm not sure what you thought would happen, but mapTileX and mapTileY are the tile coordinates on the map, not the screen if that makes sense.
And for your side note, i diddnt feel like going through all that building and i heard its unstable. Also, im loosely following a video tutorial and he is using SMFL 1.6
I assumed mapTileX/Y are the indices of the tile and that TILESIZE is
what it says and that it is a square. If all that is true it should work as that is what I do tiles[i][j].sprite.setPosition(j*32, i*32); and it works with no overlap.
Okay sorry the tile image doesnt show up so i assummed the character was falling endlessly, but he actually landed on the tile and i couldnt tell because scrolling is implemented.
So the tiles are in the right place (maybe) but the image is not showing. I'll keep looking at it i guess and let you know if i can get the image to show
Load map is called twice, once for the solid/notsolid layer and again for the images.
EDIT: I just realized that is unneccary but im keeping it for now lol
EDIT 2: I had SCREENHEIGHT and SCREENWIDTH switched in the two for loops in Map::Draw. But that diddnt solve the problem -_-
EDIT 3: I got it to work :). The problem was the guy who made the tutorial doesnt test his code and he got all his x's and y's and width's and heigh'ts messed up. Thanks for the help though!
EDIT 4: Nvm, i just put it back to the way it was originally. The lines are still there.
I was thinking i should try to find a way to make it work with your method, but using "setPosition(j*32, i*32)" it wouldnt be smooth because there can never be only portion of a tile drawn.
The "gray line" is from the blue sky background i have. When i disabled that, black lines appeared because the background was black. So for some reason the background png is coming through between the cracks of the tiles. The alpha of ever pixel in the tile is 255 so im not sure why thats happening.