Dr_Nomz
Member
I have a game where zombies are supposed to move through a barricade when it breaks, but the player can't move through it at all. (In either state)
Problem is, I can't have the broken barricade be solid or the zombie AI won't work right, so what can I do?
My walking code:
Basically I need it so it won't move if the barricade is about to be ran into, without it being solid. Also could that work with Parent objects?
Problem is, I can't have the broken barricade be solid or the zombie AI won't work right, so what can I do?
My walking code:
Code:
if keyboard_check(ord("W")) { var i=run_speed; while !place_free(x,y-i) i--; y-=i; }
if keyboard_check(ord("S")) { var i=run_speed; while !place_free(x,y+i) i--; y+=i; }
if keyboard_check(ord("A")) { var i=run_speed; while !place_free(x-i,y) i--; x-=i; }
if keyboard_check(ord("D")) { var i=run_speed; while !place_free(x+i,y) i--; x+=i; }