{ if (hspeed == 0) { if (x > Player.x && place_free(x-global.setghost,y)) { hspeed = global.setghost; vspeed = 0; } else if ( place_free(x+global.setghost,y)) { hspeed = -global.setghost; vspeed = 0; } } else { if (y > Player.y && place_free(x,y-global.setghost)) { hspeed = 0; vspeed = global.setghost; } else if (place_free(x,y+global.setghost)) { hspeed = 0; vspeed = -global.setghost; } }}Then at the end of each ghosts' step event, put this--if scared = true{Adapt_direction_scared()speed = global.setghost/2}Also, if you want the ghosts to slow down when they're blue, put this codebox at the end of the ghosts' collision event with Wall and Gate objects.if scared = true{speed = global.setghost/2}Try it and tell me if it works



Find content
Not Telling
