if (move == 1){
//Grab the correct x,y offset for the square in the direction of requested travel
var checkX,checkY,dir;
dir = direction/90;
checkX = scrGetControl(dir,arrayX);
checkY = scrGetControl(dir,arrayY);
//Record instance id of instance located at the x,y offset.
collideInst = position_meeting(x+checkX,y+checkY,all);
//Assume movement until told otherwise
move = 2;
//As long as the instance id variable is not "noone" run the switch statement
if (collideInst!=noone){
//Check for the object_index
switch (collideInst.object_index){
//When it is objWall, disallow movement
case objWall: move = 0; break;
//When it is objFinish, execute next room function
case objFinish: scrNextRoom(); break;
//When it is objTeleport, teleport to target location
case objTeleport: if (use == 1){scrTeleportTo(collideInst);} break;
//When it is none of the above, throw error.
default: show_message("Error: Case not accounted for"); break;
}
}
}
It always throws the error message. I can't figure out why it's not working properly.
An extra pair of eyes would be greatly appreciated.
111Studio











