Okay, I have many questions, mainly about subjects that haven't been discussed well in my school class, although I also have a few questions pertaining to a RPG I've been working on.
1. Threads. I've tried to search for a good tutorial on their basics, but I can't seem to find anything, can anyone explain them more fully to me. The main reason I want to use them is for monsters in my RPG, currently I am having to constantly add to a timer while doing other things to make sure the monsters do not pause while the player swings a sword. I just want to be able to assign each monster their own thread, allowing them to move independently of the rest of the game.
2. I'm having trouble making this RPG very flexible, one reason I know is because I used global variables rather than passing by reference, because of that I will most likely have to remake the majority of the program, but my main problem is, when the player swings their weapon, the 3 coordinates on the 2D array of the 3 spaces in front of the character are checked for enemies, this is where I run into some problems, as I have to brute-force each monster individually in order to check them. This makes it impossible for me to have a variable amount of monsters, as adding more requires me to brute-force even more into the program, which I want to avoid.
I've thought about using classes, and giving each monster their own class, but this is a bit of a waste of memory, and I was wondering if there was any other way I could do this.
3. Probably the main reason I want to avoid using classes is because I'm still a little shaky with them, if anyone can provide a good basic tutorial of classes and when to use them, it would be greatly appreciated.
4. Global Variables, I want to know when to use them, vs. when to pass variables around, I assume there are some basic guidelines on when to use either.
Thanks ahead of time for any answers, if you want to see the RPG so far, here's the sourcecode:
Space to Talk, ASWD to move, space to swing sword.