I am a CAD tools developer looking to transition into the game industry as a programmer. After reading this site and some others, I see that my best bet is to supplement my experience with a portfolio of game-related projects.
Typically, the transitions are part of the tiles themselves.
For instance, look in the top left of the following tileset. Notice how the grass and water meeting diagonally are part of the same tile. Same thing for sand meeting the grass, and the grass meeting the mountains.
do not know what the values of TOTAL_TILES and TOTAL_TILES_WALL actually are because they are defined in another compilation unit (they are defined in global.cpp but needed in main.cpp)
It is good practice to put
extern const int MY_GLOBAL;
in the header and
const int MY_GLOBAL = 10;
in the cpp file. In cases with non-cost objects, this is necessary to prevent linker errors. However, in this case, this leads to the above confusion.
You could actually put
const int TOTAL_TILES = 192;
const int TOTAL_TILES_WALL = 1;
in global.h and remove their definitions entirely from global.cpp and it will compile for you. And it won't produce any linker errors because constants defined like this essentially disappear as their values are copied wherever necessary without them actually taking up a linker symbol.
I am currently developing a game (and game engine in tandem) in C++. I too like the feeling of having my own code doing a lot of the heavy lifting. I have chosen to do the rendering and physics code myself and to unload the other tasks to libraries. The following is my current setup. Perhaps this can give you a rough idea of what libraries you may need to use as well.
1. What do you call the default process that automatically loops through the code and updates, whenever the program is ran? You know, the one where the computer tries to look for the Main function and run that, over and over again? Does it have an actual name, or is it fine to just call it a "built-in loop"?
There is no "built-in loop". The Main function/method is run precisely once. If you're thinking of the "Main Game Loop", then that has to be inserted by the programmer.
2. Do all programming languages have a main function/method that the computer will look for and try to run? (I'm thinking it's a necessity, but please correct me if wrong)
Answered by Wikipedia.org
3. Do all programming languages (today) cause the computer to loop infinitely through the code by default, unless you control it to do otherwise?
It's the other way around. Main is run exactly once. An infinite loop would have to programmed (or caused by a bug).
A potential solution is to "sweep out" a box (or capsule if the ends are rounded to fit the circle) that describes the motion of the circle over the whole timestep and then to do collision detection with the swept out box (or capsule). The picture below shows a swept out box.
Your globals point to locations in memory, however those locations I believe pass out of scope at the end of the function.
That part appears to be fine. Background and Image are set with LoadImage which returns a heap-allocated pointer. SDL_FreeSurface is necessary to free the loaded images (used correctly in Cleanup()).
//load the image
if(LoadFiles == false)
Here, you're not actually calling LoadFiles (the brackets are missing). Instead, this code is checking if the function pointerLoadFiles is false i.e. zero, which it isn't of course as it's a valid function.
One tool I would recommend for this purpose is Launch4j.
@warnexus It looks like you're targeting Windows, but if you target other platforms you could build one executabe wrapper for each platform.
I once had a problem where I created an executable JAR file that worked by double-clicking on my computer but it didn't work on another computer. It could have been an issue involving a JRE difference. The other advantages of using a tool such as Launch4j is that JRE differences are handled automatically (you either bundle your JRE version or you set a min and max version) and you don't have to worry about the user having to set the Java path.
Generally, say you have a gravity vector G, representing its change to an object's velocity in one time unit, and an object with velocity V0 at time zero, then in one time unit the velocity will be V1 = V0 + G, in two time units the velocity will be V2 = V0 + 2G, ... thus at time t the velocity will be Vt = V0 + tG.
e.g. Say that a projectile is launched with velocity (1, 2, 3) and gravity pulls along the vector (0, 0, -1) at 1 unit per time step. After one time unit, the projectile's velocity will be (1, 2, 2). After two time units, the projectile's velocity will be (1, 2, 1), etc. The position of the projectile at each time unit would be its position at the last time unit added to its velocity at the last time unit. This is assuming no wind and the like.