Tile Map Collisions | MonoGame Tutorial Ep. 12

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ธ.ค. 2024
  • Thanks for watching!
    Yes I covered collisions in a previous video, but this is something different! Tile maps do not need the same level of precision when it comes to 2D AABB collision. This method covered in the video shows a "blazingly fast" and pretty robust way of handling tile map collisions. I hope you enjoy!
    MonoGame Website:
    monogame.net
    Join my Discord:
    / discord
    Support me on Patreon:
    / codingwithsphere
    Source Code:
    github.com/m1c...

ความคิดเห็น • 13

  • @the_lucas
    @the_lucas 4 หลายเดือนก่อน

    I figured out to solve both at the same time today trying to do by myself. I could make it work. your videos are helping me a lot. I put to check the vertical while applying gravity and the horizontal while walking.

  • @notallama1868
    @notallama1868 4 หลายเดือนก่อน +1

    This collision method is great, but it breaks when the player size isn't perfectly divisible by the tile size. In some cases, it's not noticeable, but I found that, using your tile size of 64, if I set the player size any multiple of tiles + 6 pixels (70 or 134 for example), you start to get noticeable shaking when colliding with walls to the right or bottom, and if you set player size to anything less than 1 tile, the entire sprite can enter a wall to the right or bottom before the collision is detected and the sprite is abruptly thrown out of the wall.
    Basically, it works great as long as your sprite's dimensions are at least one tile large and no more than 5 pixels larger than the largest area you can construct within it with full tiles.

    • @bobbybuckley2346
      @bobbybuckley2346 2 หลายเดือนก่อน

      this was really helpful was stuck on why this was happening for hours lmao

  • @abc-ed9xr
    @abc-ed9xr 6 หลายเดือนก่อน

    Great tutorial! Keep em up! :D

  • @grey296
    @grey296 6 หลายเดือนก่อน

    yooo new sphere upload

  • @veronikagaynulaeva2884
    @veronikagaynulaeva2884 6 หลายเดือนก่อน

    Great tutorial!
    Are you planning to make a video about gravity, jumps and stuff?

  • @MurielSoiffer
    @MurielSoiffer 6 หลายเดือนก่อน

    que buen tutorial 👍👍

  • @cyra9544
    @cyra9544 6 หลายเดือนก่อน

    Collision handling is soo annoying. I spent a whole weak tweaking it, and i still don't like how movement feels in my game. Plus sometimes i just clip into a wall for no reason. It's actually depressing

    • @codingwithsphere
      @codingwithsphere  6 หลายเดือนก่อน

      I always have a hard time getting collisions working straight away. I like to keep a generic reference implementation to help with the headache. definitely one of the harder parts of making a game

    • @cyra9544
      @cyra9544 5 หลายเดือนก่อน

      @xmlstudios i just added like a movement collision aura. If there is a rectangle in there it starts checking it N times per frame, where N is the length of character's direction vector

    • @cyra9544
      @cyra9544 5 หลายเดือนก่อน

      Checking for collisions with the main hitbox

  • @SpikeLeonidov
    @SpikeLeonidov 6 หลายเดือนก่อน +1

    Where is the python???🫠😫

    • @codingwithsphere
      @codingwithsphere  6 หลายเดือนก่อน

      The next series will most likely use python !