Moved boundary checks to game loop.