Collisions in Pygame!

Поділитися
Вставка
  • Опубліковано 5 жов 2024
  • How collisions in Pygame work!
    ◾◾◾◾◾ Related Content ◾◾◾◾◾
    🖺 PyCharm & Python Installation: • JavaScript: Install No...
    ⭐ Python Basics: • Python Basics
    🕹️ Pygame Tutorials: • Pygame Tutorials
    ◾◾◾◾◾ 🌎 Let's Connect! ◾◾◾◾◾
    🐦 Twitter (X): 🔗 / @max_on_tech
    📂 GitHub: 🔗 github.com/max...
    🔊 Discord: 🔗 / discord
    🏹 ProductHunt: 🔗 www.producthun...
    ✅ Blog: 🔗 maxontech.io/c...

КОМЕНТАРІ • 86

  • @vedhriyer
    @vedhriyer Рік тому +4

    Thanks so much. a lot of the other youtubers started in really big topics like "self" that i dont know of. but you started simple, keep going man

    • @MaxRohowsky
      @MaxRohowsky  Рік тому +2

      Glad I could help!

    • @sazawa7702
      @sazawa7702 Рік тому +2

      "self" is really important in game development. its not that hard!

    • @TN3.1
      @TN3.1 Рік тому

      Yes same here! I am working on developing a space invaders type game and this video helped me a lot as other youtubers, like you said, all talk about self

  • @cheater8799
    @cheater8799 3 роки тому +8

    Great job! Keep up the good work!

  • @deyol1352
    @deyol1352 3 роки тому +8

    Thanks dude this really helped. Before i was doing collisons like if player_x == enemy_x:
    #do something

  • @inter-348
    @inter-348 3 роки тому +6

    Лучше тебя никто не объяснил работу с классом Rect:) Спасибо

  • @becauseimtobyfilms3559
    @becauseimtobyfilms3559 3 роки тому +4

    Exactly what I was looking for thanks 🙏
    This is a subscriber you have earnt

  • @vovo5293
    @vovo5293 Рік тому

    спасибо большое, ты смог объяснить это за 8 минут в то время как другие объясняют это минут 15-35 большое спасибо

  • @maximpro
    @maximpro 5 місяців тому

    Огромнейшее спасибо вам, вы очень помогли!!!!!

  • @medard3489
    @medard3489 3 роки тому +4

    Wow this video just helped me alot. Can you do gravity in the next video?

    • @MaxRohowsky
      @MaxRohowsky  3 роки тому +4

      nice idea. I'll keep this one in mind!

  • @supermikebros
    @supermikebros Рік тому +1

    Спасибо😀

  • @codewithshajahan9997
    @codewithshajahan9997 3 роки тому +1

    you've just earned a subscriber :)
    keep on doing the good work!

  • @Arsyspider
    @Arsyspider 21 день тому

    thank you very much! спасибо огромное!

  • @itaybechor2013
    @itaybechor2013 2 роки тому +2

    nice video it is really helped me
    btw where did you got that image of the dino?

    • @MaxRohowsky
      @MaxRohowsky  2 роки тому

      I think I actually drew it in photoshop. you can find it on my github: codewmax

    • @itaybechor2013
      @itaybechor2013 2 роки тому

      @@MaxRohowsky ok thx!

  • @BorNation
    @BorNation 3 роки тому +2

    very simple thanks you!!

    • @MaxRohowsky
      @MaxRohowsky  3 роки тому

      You're welcome! Glad it helped :D

  • @chrisbana5874
    @chrisbana5874 9 місяців тому

    Bro thanks alot I've been dying with that collision thing

    • @MaxRohowsky
      @MaxRohowsky  9 місяців тому

      Awesome :) Glad it helped!

  • @adarshkhatri993
    @adarshkhatri993 3 роки тому +2

    I thought It was hard before watching Full but after watching It is fucking easy..😊

  • @rickyasbury1878
    @rickyasbury1878 Рік тому

    This isn’t what I was looking for but very close I was looking for an on key press collide with object

  • @rbq2924
    @rbq2924 3 роки тому +3

    How would you make it so the dinosaur stops when it gets to the rectangle?

    • @MaxRohowsky
      @MaxRohowsky  3 роки тому

      Hey, sorry for the late reply rubiq. That is something that I actually explain in another video. You should find what you are looking for at the end of the following video: ua-cam.com/video/xQ5UCzFKR58/v-deo.html
      Best,
      Bucket :)

    • @Luke-bo4cv
      @Luke-bo4cv 2 роки тому +1

      @@MaxRohowsky I looked at the video and I couldn't seem to find the bit you were talking about

    • @soundwavetb8636
      @soundwavetb8636 Рік тому

      You can say if it becomes higher then this coordinates, Dino.y Dino.X = this coordinates

  • @charles9844
    @charles9844 3 роки тому +1

    Parabéns pelo vídeo 👏🏻👏🏻👏🏻

  • @ayakiaq1988
    @ayakiaq1988 Рік тому

    Works just fine. Thanks

  • @raoufabdallah2316
    @raoufabdallah2316 Рік тому +1

    my game is always detecting collision even if there is none

  • @jorgesoto7991
    @jorgesoto7991 Рік тому

    Thank you for the tutorial :3

  • @rubylikessonic2
    @rubylikessonic2 3 роки тому +2

    How would you change it for a collision of two images instead of an image and a rect?

    • @jaysanprogramming6818
      @jaysanprogramming6818 3 роки тому +3

      get the rect of your images and you can use them for collision.

    • @mikuculus3720
      @mikuculus3720 3 роки тому +2

      Use get_rect() on your image

    • @MaxRohowsky
      @MaxRohowsky  2 роки тому

      I need some more pygame geeks in my discord community :D Feel free to join guys! discord.com/invite/JERatQsfY8

    • @ytphmaker2323
      @ytphmaker2323 10 місяців тому

      @@jaysanprogramming6818 how? i dont get it. i mean, how do you use them for collisions?

  • @ItsNoxL
    @ItsNoxL 2 роки тому +1

    👍 thanks!

  • @komboiko7292
    @komboiko7292 3 роки тому +1

    thank you so much

  • @soundwavetb8636
    @soundwavetb8636 Рік тому

    Can I make the Dino’s rect (hitbox) smaller?

    • @MaxRohowsky
      @MaxRohowsky  Рік тому

      Yes, you could do that by making the image smaller.

  • @jaya9937
    @jaya9937 3 роки тому +1

    i like ur channel to grow

    • @MaxRohowsky
      @MaxRohowsky  3 роки тому

      I'm working on it! :) Glad you like it

  • @ajmarcelo8532
    @ajmarcelo8532 2 роки тому

    it works but how to add more obstacle?

    • @MaxRohowsky
      @MaxRohowsky  2 роки тому

      Hi AJ, this video might help: ua-cam.com/video/wnBGG7JLrkg/v-deo.html

  • @flashypluto5927
    @flashypluto5927 6 місяців тому

    what editor are you using?

  • @mihailozaric9187
    @mihailozaric9187 2 роки тому

    I just have a question, how do u add an extension on the left
    thx

    • @MaxRohowsky
      @MaxRohowsky  Рік тому

      What do you mean by extension to the left?

    • @mihailozaric9187
      @mihailozaric9187 Рік тому

      @@MaxRohowsky i meant the in the program ur puting the code in but i relised ur just using pycharm

  • @lemy319
    @lemy319 2 роки тому

    Thanks

  • @fayzanmalik786
    @fayzanmalik786 2 роки тому

    how can you make the obstacle move

    • @MaxRohowsky
      @MaxRohowsky  2 роки тому

      this video will help: ua-cam.com/video/wnBGG7JLrkg/v-deo.html

  • @jhonnvyctorlimaalves5932
    @jhonnvyctorlimaalves5932 3 роки тому

    nice video

  • @rexgaming1113
    @rexgaming1113 3 роки тому

    thank you

  • @hasanh6822
    @hasanh6822 3 роки тому

    thanks bro

  • @ivan-pašti
    @ivan-pašti 2 роки тому

    how can i hide that rect?

    • @MaxRohowsky
      @MaxRohowsky  Рік тому

      Try giving it the color of the background or a border line of 0 pixels

  • @wormedw
    @wormedw 3 роки тому

    6:44 is what you came here for

  • @jaya9937
    @jaya9937 3 роки тому +1

    best

    • @MaxRohowsky
      @MaxRohowsky  2 роки тому

      Hey, I'm going through my comments picking up early supporters to join my discord! Feel free to join: discord.com/invite/JERatQsfY8
      Best
      Bucket :)

    • @jaya9937
      @jaya9937 2 роки тому

      @@MaxRohowsky glad cuz ur videos are awesome
      btw max i highly request u to make godot tutorials

  • @skycrepp9215
    @skycrepp9215 4 роки тому

    👍👍

  • @strike6621
    @strike6621 3 роки тому

    I am the 100th subscriber!

    • @MaxRohowsky
      @MaxRohowsky  3 роки тому

      This is amazing. Thanks so so much! Seeing the support is overwhelming!

  • @saravanants2593
    @saravanants2593 3 роки тому

    Moving a thing with pygame.key.getpressed didn't work

    • @qwatzy
      @qwatzy Рік тому

      its pygame.key.get_pressed u forgot underscore

    • @MaxRohowsky
      @MaxRohowsky  Рік тому

      Quartzy is right :)