W
Winter_Snake
Guest
Create Event:
Step Event:
So what I want my program to do is to cycle through however many connectionPoints there are and do certain functions based on that. The reason why I am doing it this way (or at least assume this is a better way of doing this) is because I want the users to be able to mod the game when completed so the can change/add/remove connectionPoints at free will. And if I were to make it a static number, they'd have to manually change that.
The problem with the coding is, it infinitely loops. I don't know why because I assume that once it gets to connectionPoints[4] it sets it to "" or 0. I've tried both, but it still infinitely loops itself and crashes the game. any help would be great!
EDIT: I should also mention I'm using Game Maker 8.1
Code:
connectionPoints[0] = "TopCenter";
connectionPoints[1] = "BottomCenter";
connectionPoints[2] = "LeftSide";
connectionPoints[3] = "RightSide";
Code:
var cPa, cPb;
cPa = 0;
for(cPb = connectionPoints[cPa]; !(cPb = ""); cPa += 1;)
{
//Do certain functions
}
The problem with the coding is, it infinitely loops. I don't know why because I assume that once it gets to connectionPoints[4] it sets it to "" or 0. I've tried both, but it still infinitely loops itself and crashes the game. any help would be great!
EDIT: I should also mention I'm using Game Maker 8.1