Moved populating of gateX and gateY to game loop