J
James71603
Guest
Hello. I am new to forums and would be ecstatic if someone would see what is wrong with my code. I made a script for checking movement. Basically, it checks if there is a wall colliding with the player. It doesnt seem to work and i know there is some other way of doing it but can someone please help?
Here is the script for Left movement:
wallArray[0] = obj_wallStraight
wallArray[1] = obj_wallHorizontal
wallArray[2] = obj_wallLeftCornerBottom
wallArray[3] = obj_wallLeftCornerTop
wallArray[4] = obj_wallRightCornerBottom
wallArray[5] = obj_wallRightCornerTop
left = keyboard_check(vk_left);
if(left && !position_meeting(obj_mazeRunner.x,obj_mazeRunner.y, for(var i= array_length_1d(wallArray); i =< 0; i-- {
wallArray;
})) x -= 3;
Here is the script for Left movement:
wallArray[0] = obj_wallStraight
wallArray[1] = obj_wallHorizontal
wallArray[2] = obj_wallLeftCornerBottom
wallArray[3] = obj_wallLeftCornerTop
wallArray[4] = obj_wallRightCornerBottom
wallArray[5] = obj_wallRightCornerTop
left = keyboard_check(vk_left);
if(left && !position_meeting(obj_mazeRunner.x,obj_mazeRunner.y, for(var i= array_length_1d(wallArray); i =< 0; i-- {
wallArray;
})) x -= 3;