You are working too hard! I notice pretty much everywhere, you are misusing "if" statements. What I mean is this...
// Your code
if (StartGame>2) vbTextOut(0, 20, 11,"IMPORTANT:");
if (StartGame>2) vbTextOut(0, 14, 12,"SCREW THE INSTRUCTION");
if (StartGame>2) vbTextOut(0, 13, 13,"AND PRECAUTION BOOKLETS");
if (StartGame>2) vbTextOut(0, 15, 14,"JUST PLAY THE GAME.");
So yes, you are right that after an if statement, it will execute everything until the ;. Well, usually that is. But the preferred way is to use {} braces (usually called "curly braces"). Then it will do everything in between the {} braces (unless you did something bad like a goto). So anyway, you can rewrite the code like this then...
// Right way
if (StartGame>2) {
vbTextOut(0, 20, 11,"IMPORTANT:");
vbTextOut(0, 14, 12,"SCREW THE INSTRUCTION");
vbTextOut(0, 13, 13,"AND PRECAUTION BOOKLETS");
vbTextOut(0, 15, 14,"JUST PLAY THE GAME.");
}
Notice I can get multiple things done with the same "if" statement, and I don't have to use "," between each thing. (the comma is almost never used in C).
For safety, you should always use the { and } braces every time you use an if statement (or for(;;) or while())
Then, lets look at this next bit of code...
if (fighter==1) vbTextOut(3, 1, 0,"GI-ANT ");
if (fighter==2) vbTextOut(3, 1, 0,"BEHE-MOTH ");
if (fighter==3) vbTextOut(3, 1, 0,"RUMBLEBEE ");
// and so on until 8, but let's limit the scope to just 3 for now
The problem with this is that if "fighter == 1" then you know "fighter == 2" cannot be true, yet you still check it. This just wastes time. One way is to use the "else" statement along with "if". Here is an example...
if (fighter==1) {
vbTextOut(3, 1, 0,"GI-ANT ");
} else if (fighter==2) {
vbTextOut(3, 1, 0,"BEHE-MOTH ");
} else if (fighter==3) {
vbTextOut(3, 1, 0,"RUMBLEBEE ");
} else {
// If you want to do something when none of the above
// is true, you can put it here. let's just leave it
// blank to match your original intent.
}
That is better, because if fighter == 1, you do not check the rest. But if fighter == 3, you still check first if fighter == 1, then if fighter == 2 before finally checking if fighter == 3. Bummer.
Another alternative in a case like this is the "switch" statement. This is very similar to the if/else example, except it is a little bit easier to read. It also can have performance gains, but it is more limited than the if/else statement. Either way, check out the example...
switch (fighter) {
case 1:
vbTextOut(3, 1, 0,"GI-ANT ");
break; // Never forget this break! It lets the switch know you are done.
case 2:
vbTextOut(3, 1, 0,"BEHE-MOTH ");
break;
case 3:
vbTextOut(3, 1, 0,"RUMBLEBEE ");
break;
default:
// If none of the above cases are true, you do this
// It is okay to leave it empty, or just not include it
// but good programming says you should always include one
// Don't forget to use break, even if you leave it empty!
break;
}
So basically, the first part (switch(fighter)) says "I want to do things based on the value of "fighter". Then "case 1:" essentially means "if fighter == 1, do all the code up until the break; command". You can also see the "default" at the bottom of the switch is the same as the last "else" in the if statement.
The downfall with "switch" is that it only checks if things are equal. You cannot have a case for "if greater than"
Anyway, back on track, try going through your code making the following changes...
1) Always use {} with if() statements
2) Use if/else statements to prevent tests that you know will fail
3) Use switch statements when you want to do different things based on a single variable having different values.
There is still much more that can be done to speed up the code and make it more readable, but try to master the above first before moving on to the next steps.