Well, a while loop keeps on going until a condition is false ex:
int end = 0;
while (end != 1) {
if (dbEscKey()) {
end = 1;
}
// Game Code...
}
And a For Loop keeps on going until a condition is meet (in the example, it is while variable "i" is less than "10".
int sprites[10] = {12, 2, 5, 6, 3, 1, 7, 4, 9, 8};
for (int i = 0; i < 10; i++) {
dbShowSprite(sprites[i]);
}
You can also see that For loops can be used to cycle through arrays, while loops can do this too, but it's a bit more logical for a for loop to do that.
http://www.darkgdk.us/ <- You can now submit pages, upload images, yet were lacking content. We need your help!