TOTAL_TILES = (LEVEL_WIDTH/TILE_WIDTH)*(LEVEL_HEIGHT/TILE_HEIGHT);
So simple is that.
But…
First of all:
/* This source code copyrighted by Lazy Foo' Productions (2004-2015) and may not be redistributed without written permission. */
secondly:
from:
Q: I don’t get tutorial/article X.
A: Well contact me and I’ll try to explain it better and maybe make adjustments to the tutorial.It is in my interest that people learn from my tutorials. If people can’t learn from my tutorials, honestly what good are they?
That person wrote that tutorial for a reason, he wanted get the Idea how a tile map editor works.
That is the simplest form one can have, it is loosely knit mixed C/C++ code.
It was good enough for him/her to get it rudimentary working and thought it would be a good idea to share the code, what I appreciate.
Personally I wouldn’t use C++ code for those short tutorials at all, cause all those classes are just distracting from the topic and the compiler output if you run in errors is massive. The compilation time even without cmake is horrible but negligible. So in the end it is a matter of taste and I guess if you code in C++ you need tutorials in that languages. I think for those things Pseudocode works best and at the end, some implementations could be provided.
“If you want to pick a strawberry, you don’t need a master plan… just pick it.”
Why would you struggle to work with a prototype instead of a mature, well supported piece of software?
Software development is expensive, thousands of hours going to development unsure if the project will be successful. Most projects aren’t useful unless they are 5 years developed and maintained.
Just watch this:
https://www.openhub.net/p/sdl
took an estimated 80 years of effort (COCOMO model)
starting with its first commit in April, 2001
I wonder where all this “Game-Engines” and “MapEditors” starting here will go ?!?!
What projection of the tiles do you need?
Orthogonal Projection, Oblique Projection, Isometric Projection, Isometric Stagger, Isometric Terrain?
And how about
Cheers,
–Cass
Update:
Pitfall!,
working name jungle runner
designed by David Crane for the Atari 2600 and released by Activision in 1982 was written by him in 64 weeks ~ 1,000 h. And I don’t think he was uneducated or lazy - probably he was smarter than me at that age and software development for that hardware was easier IMO cause of all those constraints. He didn’t waste his time on picking one out of 16,8 mil. colors and did not need a master degree in Media-Design to make the choice.
What I mean by this, even if you are a hobbyist you need something like project management and a goal or in the end you will achieve nothing.