These should be using world.maxx, world.maxy instead of 1 and 255