Problems with 2D Tile Engine C++ SDL

Started by
21 comments, last by Mythios 15 years, 4 months ago
Mate thank you so much for all your time and effort you have put into helping me here. It's really helped a heck of a lot for me. So seriously thank you heaps! Only other question now is - i know the code is very messy. So i was wondering if you could guide me which of the functions that are in the main i would probably able to move into the tile class. Mainly so I can neaten it up and actually have a tile engine sort of thing i can use for games i create :)

Thanks a heap man!
Advertisement
Learn to use and love vectors. They're all around better than arrays in my book.

As for cleaning up your code, it's a matter of preference. I like everything wrapped up neatly in objects with as little internal information exposed as possible. You could do the same, and write a Tilemap (as opposed to your current tile class) class that takes string arguments for the tile sheet and the map, and the work of loading the sheet and map with the tile offsets is neatly tucked away.
If I put my 2 cents in and get a penny for my thoughts, where does my other penny go?
I kind of get what you mean but a lot of that goes over my head still lol. Mainly as this is my first time using SDL as well so getting use to a lot of it and stuff. I also need to get better at using vectors and iterating through them and what not as i never use them much. I've always stuck with arrays but that's probably a bad idea.

Cheers

This topic is closed to new replies.

Advertisement