Pygame Event Handler Explained

Поделиться
HTML-код
  • Опубликовано: 3 авг 2024
  • In this video I will explain how the event handler in pygame works, how to check for events and go over some of the common event types.
    I'll demonstrate the different events in a basic pygame program to see how they work.
    Take a look at the tutorial on my website for a reference on pygame events here: www.codingwithruss.com/pygame/...

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

  • @MoonisHavn
    @MoonisHavn Год назад +5

    Great info in such a digestible timeframe. Really enjoy the channel.

  • @CodingWithRuss
    @CodingWithRuss  Год назад +1

    Hello folks! Visit codingwithruss.com/tutorial/handling-events to get the code and a quick reference of what was covered in this video.

  • @Iriana_Star
    @Iriana_Star 10 месяцев назад +2

    Thank you ❤😊for the video
    I followed every step, and it worked perfectly for me ❤😊

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

    love you sir you taught me so many things ❤❤❤❤❤❤❤❤❤❤

  • @user-hd8dv1hi9k
    @user-hd8dv1hi9k Год назад +5

    Nice video mate. 👍

  • @ToujoursIris
    @ToujoursIris Год назад +1

    congrats for 15k subscribers! still waiting for discord server or any social media app where we can post doubts

  • @tristandombroski9677
    @tristandombroski9677 Год назад +1

    Thank you!

  • @lightingzr
    @lightingzr Год назад +1

    Very good tutorial!

  • @Xplouding
    @Xplouding Год назад +1

    Hi, thanks for this stuff!!! I've a question!! Is there any way to execute special movements, by a sequence of buttons pressed in a certain order?? For example... a "Hadouken" in Street Fighter!!

    • @CodingWithRuss
      @CodingWithRuss  Год назад +1

      Hmm that's an interesting one! I'm sure you could do something like that. If I was doing this I would try using a timer that resets after each key, that will ensure the keys in the combo are pressed quickly one after another. Then I'd have a variable that starts at zero like combo=0 and then each key increases it by one. Pressing the wrong key or taking too long between keys would reset it back to 0. Otherwise, you keep increasing by 1 until the combo is complete so if the sequence has 4 steps, then you would check if combo == 4. Lastly you would need a way of storing your sequence order and checking what the next button is, which you could do with a list. Store each button in the list and that way you could also use the combo variable as the index for that list to check which button should be pressed next.
      You could give that a go and see how you get on.

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

      @@CodingWithRuss thanks, I’m trying something like that, but, I’ve not idea if, “that‘ the way”... I’ll keep on.... thanks bro!!!

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

    Use FINGERDOWN to get multiple touches in pygame (touchscreen)

    • @CodingWithRuss
      @CodingWithRuss  Год назад +1

      Yes good point. There are so many events that can be detected within pygame

  • @nbk9930
    @nbk9930 Год назад +4

    can we built a career in game development if we know pygame.

    • @sonicfan88321
      @sonicfan88321 Год назад +3

      in theory, yes
      in practice, due to python being very slow on larger programs, it's not ideal

    • @griswoldthegoblin9420
      @griswoldthegoblin9420 7 месяцев назад

      I think you have better chances doing smth else with programming other than game development.

    • @ganyuolheiser7822
      @ganyuolheiser7822 5 месяцев назад

      Pygame is good for simple 2d games with hardly any power to run

    • @DailyAero101
      @DailyAero101 2 месяца назад

      It’s a good start

  • @ashururakov3617
    @ashururakov3617 Год назад +1

    #problem #help #sos
    hello, I have some trouble in sublime text 3. When I run my file in cmd, it runs well, but in sublime text it says "module 'pygame' is not found".
    help me please, I dunno how to fix this

    • @somethingrandome6105
      @somethingrandome6105 8 месяцев назад

      go to the terminal in your computer and then type in "pip install pygame"

  • @Therealchessenjoyer
    @Therealchessenjoyer 6 месяцев назад

    Anyone else got an indent error on line 12 too?

  • @furiouswizard8168
    @furiouswizard8168 10 месяцев назад

    is it ethical to steal codes from other games

    • @spoonmaster4440
      @spoonmaster4440 6 месяцев назад

      if its open source/allowed, go ahead, if not, then no, in fact its illgal

  • @ToujoursIris
    @ToujoursIris Год назад +6

    First :)