-- don't change the world in case of any other events

-- Move horizontally, but box the character in at the window boundaries.
moveX (x, y) offset = if x + offset < (-width / 2) + slimeWidth / 2
                      then ((-width / 2) + slimeWidth /  2, y)
                      else if x + offset > width / 2 - slimeWidth /  2
                      then (width / 2 - slimeWidth /  2, y)
                      else (x + offset, y)
moveX (x, y) offset = if x + offset < (-width / 2) + slimeWidth / 2
                      then ((-width / 2) + slimeWidth /  2, y)
                      else if x + offset > width / 2 - slimeWidth /  2
                      then (width / 2 - slimeWidth /  2, y)
                      else (x + offset, y)
moveX (x, y) offset = if x + offset < (-width / 2) + slimeWidth / 2
                      then ((-width / 2) + slimeWidth /  2, y)
                      else if x + offset > width / 2 - slimeWidth /  2
                      then (width / 2 - slimeWidth /  2, y)
                      else (x + offset, y)