Original Post
Hi,
i wrote some code for a tile based game, but the tiles aren't working correctly.
I tried solving this problem for the last days, but i didn't find a saluting, i hope you can.
The problems are:
1. The result of the tile placing is very strange, but i can't find any problems with the code of it.
2. This is not so important, but it would be good to know, why the color keying doesn't work, maybe the picture doesn't work with colorkeying or the code itself is wrong. I don't know.
Some notes:
1. I commented the code a lot for you, so you can understand it.
2. You will need SDL + SDL_image to compile it, because it like it to have png files as images.
3. I don't know why i should write it here, but maybe it helps to know that my operating system is OS X LION.
4. I'm a beginner in programming SDL and this is my first game i want to program.
5. I'm from germany (this includes a sorry for mistakes, if you find any in the text), if you can speak german too i think it's better to write in german for me.
6. I wrote my email at the top of the main.cpp if you want to contact me without gamedev.net.
The code (main.cpp) + the tile sheet (everything made by me) + the background (a white background =D):
It should be downloadable down here(, if it worked xD):
[s]----[/s]> [attachment=5285:tilesheet + background + maincpp.zip]
And now its time to thank you for hopefully good answers.
i wrote some code for a tile based game, but the tiles aren't working correctly.
I tried solving this problem for the last days, but i didn't find a saluting, i hope you can.
The problems are:
1. The result of the tile placing is very strange, but i can't find any problems with the code of it.
2. This is not so important, but it would be good to know, why the color keying doesn't work, maybe the picture doesn't work with colorkeying or the code itself is wrong. I don't know.
Some notes:
1. I commented the code a lot for you, so you can understand it.
2. You will need SDL + SDL_image to compile it, because it like it to have png files as images.
3. I don't know why i should write it here, but maybe it helps to know that my operating system is OS X LION.
4. I'm a beginner in programming SDL and this is my first game i want to program.
5. I'm from germany (this includes a sorry for mistakes, if you find any in the text), if you can speak german too i think it's better to write in german for me.
6. I wrote my email at the top of the main.cpp if you want to contact me without gamedev.net.
The code (main.cpp) + the tile sheet (everything made by me) + the background (a white background =D):
It should be downloadable down here(, if it worked xD):
[s]----[/s]> [attachment=5285:tilesheet + background + maincpp.zip]
And now its time to thank you for hopefully good answers.