Implementation of stage border hit detection