• bitchkat@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      1
      ·
      6 months ago

      How do you put something in a 2 dimensional space? A square has no height.

      • Daxtron2@startrek.website
        cake
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        6 months ago
        if(player1.x < player2.x + player2.width &&
            player1.x + player1.width > player2.x &&
            player1.y < player2.y + player2.height &&
            player1.y + player1.height > player2.y)
        {
            //collision
        }