Mouse Input - Pygame Tutorial

Поделиться
HTML-код
  • Опубликовано: 23 дек 2024

Комментарии • 60

  • @mixlaproduction
    @mixlaproduction 4 года назад +18

    You are so awesome for making these! I enjoy watching your series! This channel is a pure gem

  • @hangmanCode7064
    @hangmanCode7064 2 года назад

    Can someone help. I have got to 6:05 and when I try to run it, it says;
    local variable 'clicking' referenced before assignment
    Can someone help me with this please.

  • @jessicacristinasantosdonas5975
    @jessicacristinasantosdonas5975 3 года назад

    what if I would like to drop thatimage and be able to select another one in the screen and make this new one follow my mouse movements?

  • @roydonk2878
    @roydonk2878 4 года назад +12

    Thanks for the tutorial! I'm wondering, how did you get so knowledgeable about Pygame? I've noticed through my own investigating that resources dedicated to Pygame are so scarce compared to engines like Godot or Unity. Did you learn mostly through trial and error?

  • @furykool
    @furykool Год назад

    Hey, I used this method but found the mouse wheel scrolling is really bad at datection, any other method you suggest?

  • @echo3_609
    @echo3_609 2 года назад

    Would be kind enough to help me on how to get collisions from touch screen input

  • @alexbaker4511
    @alexbaker4511 3 года назад

    anyone know how to check if an image is clicked?

  • @riyamandal7667
    @riyamandal7667 2 года назад

    What does this offset word mean in games?

  • @will_warrior351
    @will_warrior351 3 года назад +1

    Just got here and I am already thanking you!

  • @x2hamburger
    @x2hamburger 4 года назад +3

    Bruh this guy only has 8k subs he deserves at least 100k.
    Nice vid bro.

    • @rmr_md6834
      @rmr_md6834 4 года назад +1

      Did you mean at least 1M?

  • @adryncharn1910
    @adryncharn1910 4 года назад +4

    For me i usually always used something like this for mouse button input: mouseleft, mousemiddle, mouseright = pygame.mouse.get_pressed().
    Anyways, nice vid, im glad there is someone else who also uses pygame and python for making games :)

    • @thomascasasnovas4372
      @thomascasasnovas4372 4 года назад

      Same (: But now I wonder if one of the two is faster or more efficient than the other...

    • @mingyi456
      @mingyi456 4 года назад

      @@thomascasasnovas4372 The difference is that pygame.mouse.get_pressed() repeats every frame the button is held down so it will behave similarly to the left mouse button in this example. This is more efficient if you only need this behavior because it does not do some boolean toggling but it also does not respect order of events like the pygame event queue

    • @DaFluffyPotato
      @DaFluffyPotato  4 года назад +1

      Generally I like to work from a lower level so I can have more options easily available to me.

  • @estebanqqquito
    @estebanqqquito 3 года назад

    can this work with bouncing balls?
    i need help doing mouse interaction for bouncing balls

  • @fakeinsten7839
    @fakeinsten7839 3 года назад

    hey fluffy can you help me out to upload a .png image as the cursor image for pygame...and thanks in advance.

  • @LoveTheUmmah822
    @LoveTheUmmah822 3 года назад

    i am trying to make a charachter slowly follow my mouse how do i do that?

    • @الإسلامدينالحق-خ5ت
      @الإسلامدينالحق-خ5ت 2 года назад

      My friends, search for your life purpose, why are we here?? I advise you to watch this series and this video 👇 as a beginning to know the purpose of your existence in this life.., ruclips.net/p/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-
      ruclips.net/video/7d16CpWp-ok/видео.html

  • @abhiudaitiwari8039
    @abhiudaitiwari8039 3 года назад

    Which code editor are u using

  • @riccardosgoifo5612
    @riccardosgoifo5612 4 года назад

    Can you male a video about the GUI?

  • @theleeyawnshow
    @theleeyawnshow 3 года назад

    Hi bro, how can you make the image follow to the current mouse position instead of the immage following it around?

    • @theleeyawnshow
      @theleeyawnshow 3 года назад

      I mean, something like league of legends or dota wherein when you righ click somewhere in the map, your hero follows at a certain speed. I'm making an adventure mmo using pygame but only knows keyboard events. I hope you or anyone can help.

  • @majnonshahrr190
    @majnonshahrr190 4 года назад

    Do you think that relatively large projects(2d) can be done with this library(py game)????

  • @Rocco7070
    @Rocco7070 3 года назад

    wich vs code theme are you using?

    • @dihydrogen
      @dihydrogen 2 года назад

      i believe he's using atom not vs code

  • @manas6340
    @manas6340 4 года назад +1

    Thanks,I was looking for this for weeks.I was not able to do left clicking on the image in the program.

  • @vybz352
    @vybz352 3 года назад

    Hey thanks for tutorial but i have a question, how can i make it so the mouse cursor is in the middle and not the top left?

    • @الإسلامدينالحق-خ5ت
      @الإسلامدينالحق-خ5ت 2 года назад

      My friends, search for your life purpose, why are we here?? I advise you to watch this series and this video 👇 as a beginning to know the purpose of your existence in this life.., ruclips.net/p/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-
      ruclips.net/video/7d16CpWp-ok/видео.html

    • @juicedelemon
      @juicedelemon 2 года назад

      make a rect:
      rect = surface.get_rect(center=(x, y))
      and then blit it:
      screen.blit(surface, rect)

  • @simplepycodes
    @simplepycodes 4 года назад

    Thanks for the video. do you recommend to use pymonk library for physics in 2D games?

  • @ratoganersacudo479
    @ratoganersacudo479 4 года назад

    thanks man i thought it's impossible make good games with python but you make me believe thank so much

  • @Morrwena
    @Morrwena 4 года назад

    which editor/engine are you using,cant understand what is that

  • @nehz_ttv
    @nehz_ttv 4 года назад

    Why you don’t use OOP?

    • @DaFluffyPotato
      @DaFluffyPotato  4 года назад +2

      It’s a waste of time for some stuff.

    • @nehz_ttv
      @nehz_ttv 4 года назад

      @@DaFluffyPotato Understand)

  • @hm4266
    @hm4266 4 года назад

    Yo did you participate in GMTK jam?

  • @rudranagk1403
    @rudranagk1403 3 года назад

    Increase the font size for god sake

  • @andreicostea8625
    @andreicostea8625 4 года назад

    Do you recommend using pypy?

  • @jonathanfin1727
    @jonathanfin1727 4 года назад +1

    Love your videos, just subscribed.
    U teach me a lot, keep going ;)

  • @vadimmereuta2283
    @vadimmereuta2283 3 года назад

    You help me a lot , thank you

  • @alphacraft9658
    @alphacraft9658 2 года назад

    I gave the 500th like! 😄

  • @sumukhjagirdar5860
    @sumukhjagirdar5860 4 года назад

    AWESOME!!!

  • @bojanjeremic1411
    @bojanjeremic1411 3 года назад

    Love it

  • @hextav
    @hextav 4 года назад

    Yes

  • @andrejprenkelushaj9499
    @andrejprenkelushaj9499 4 года назад

    dieng is portnt so yeeaas

  • @bpm.coding
    @bpm.coding 4 года назад

    mmm