html platformer - correct box collision