Posted By: xbox
empty pointer in door left and door right - 05/06/11 03:57
I don't understand the error at all, I'm not a complete noob to this but I don't see a reason for error. Can anyone please help?
Code:
#define init_xpos skill1 action door_left() { while(!player) { wait (1); } my.init_xpos = my.x; while(1) { while(vec_dist(player.x, my.x > 30)) { wait(1); } while(my.x > (my.init_xpos - 40)) { my.x -= 3 * time_step; wait(1); } while (vec_dist(player.x, my.x) < 100) { wait(1); } while (my.x < my.init_xpos) { my.x += 3 * time_step; wait(1); } my.x = my.init_xpos; wait(1); } } action door_right() { while(!player) { wait(1); } my.init_xpos = my.x; while(1) { while(vec_dist(player.x, my.x > 30)) { wait (1); } while(my.x < (my.init_xpos + 40)) { my.x += 3 * time_step; wait(1); } while (vec_dist(player.x, my.x) < 100) { wait(1); } while (my.x > my.init_xpos) { my.x -= 3 * time_step; wait(1); } my.x = my.init_xpos; wait(1); } }