i told you by the xmax and ymax arrays aswell as saying if x<0 then x=0 and if y<0 then y=0 if y>ymax then y=ymax and vice versa.