Pygame Saving and Loading Tutorial: Creating Customizable Controls

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

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

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

    Really helpful man. Thanks. Can you make a tutorial on how to make different level for a game and how to make the transition between levels after pressing a button. I've been wanting this. Thanks :)

  • @cliffordwilliam3714
    @cliffordwilliam3714 3 года назад +2

    Oh yes more! Your videos have been super helpful thank you so much. Ive been thinking on using state machine for player control similar to how you handle game states. Would that be an improvement to the player class? Especially when the player can do more than just jumping and running. Also would be awesome if you make a tutorial on shooting mechanic like the one in cave story!

    • @CDcodes
      @CDcodes  3 года назад +2

      State Machines are awesome for player characters! I was thinking about doing a tutorial on those. And i'll take that into consideration! Thanks for the support!

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

      @@CDcodes Looking forward to it and subbed! You're the best :D

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

    great! My idol has released a video again!!! thank you so much

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

      My programming skills have improved a lot. you are my idol!

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

      Really happy to help! Keep on coding!

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

    Congrats on 1k! It costed me a channel strike lol but it was worth it 👊

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

      Lmao I appreciate the support!

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

    Awesome Video!

  • @ahmadsyahmibinjamaludin1036
    @ahmadsyahmibinjamaludin1036 2 года назад +1

    I'm wondering how can I make a game button that has a function like 1p mode and 2p mode on super smash bros?

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

    Can't get it to work because when I save it saves the integers, not the "pygame.K_a" type codes.
    when I load in my JSON I can't load in direct pygame methods so I have to load them in as strings, and then evaluate them. But I can't get the codes from the integers, and I can't get the integers to work as a pygame event.

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

      Strange, the "pygame.K_a" codes are just integers, so it should still work when you save it as one. Stop by the discord and maybe someone can help?

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

    Hello,Christian!
    self.font = pygame.font.Font("RetroFont.ttf", 20)
    FileNotFoundError: [Errno 2] No such file or directory: 'RetroFont.ttf'
    why do i get this all the time
    ps :i installed everything you said to install

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

      It seems as though it can't find the font file. Make sure that your font file is in the same directory and that you are spelling the filename correctly (watch out for spaces, capitalization, etc). You couls also use os.path.join() to make sure it is being found

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

      @@CDcodes Thank you very much

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

    What happened to you, man. You haven't uploaded in a while.

    • @CDcodes
      @CDcodes  2 года назад +1

      Still alive, new video out today : )