One of the other things to be careful of with AppGameKit in Tier 2 is handling strings.
Anytime you get a string from some AppGameKit function, you need to remember to clean up afterwards. The strings are dynamically created on the heap and need to be deleted when done. Otherwise you are creating a memory leak that might come back to bite you in the butt.
Here is an example of how to properly handle a string returned from AppGameKit, using std::string (the best thing for doing string things):
// declare your variables
std::string my_str;
char* agk_str;
// get a string from AGK, in this case convert a number
agk_str = agk::Str(159.10);
// now put it in the std::string that will do proper cleanup later
my_str = agk_str;
// now clean up, note the use of [], it is done because all
// AGK functions create strings using char* str = new char[123]
// the number 123 was picked at random
delete[] agk_str;
// now you do things with my_str
The reason you don't simply directly assign the output of agk::Str() to a std::string is that the std::string makes a copy of the string assigned to it and does nothing with the source. It does not clean it up or store the pointer or anything.
This concept/issue is one of the things done in the tutorial whose code I posted further up this thread.
Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master