Pygame Tutorial - Image Rotation Around a Pivot Point

Поділитися
Вставка
  • Опубліковано 29 вер 2024
  • In this video I show you how to rotate images around a pivot point using two examples. In the first example we create a rotating spikeball common to many side scroller games. In the second example we rotate a weapon image around the center of the screen to point in the direction of the mouse, another common feature in sidescroller and topdown games.
    Code here: github.com/big...
    Join the discord here:
    / discord
  • Ігри

КОМЕНТАРІ • 27

  • @SpaceCatAtelier
    @SpaceCatAtelier 8 місяців тому +7

    This is exactly what i needed, thanks for the tutorial!

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

    i think it would be good that instead of explaining then becoming silent for a bit many elaborate further or show an ilistartion

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

      I'll look into that for my next tutorial. Thanks for the feedback.

  • @rethanon
    @rethanon Рік тому +6

    You’re posting some good tutorials, just a friendly suggestion but would be better to increase the text size to make it easier to read. A lot of people will either watch windowed while trying to follow along or will perhaps be watching on a smaller device like a phone or iPad for example. Great job though!

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

      Thanks for the feedback, will do in the future.

  • @jstro-hobbytech
    @jstro-hobbytech Місяць тому +1

    hey man. when you make your tilesets it must take forever does it? i want to do more with pygame but i code and play guitar better than i draw. great content by the way.

    • @bigwhoopgames
      @bigwhoopgames  Місяць тому

      Thanks. I just add one tile at a time and am always redrawing them. I never get it on the first try.

  • @kristofferjohansson3768
    @kristofferjohansson3768 2 місяці тому +1

    Really good tutorial on a specific topic. Thumbs up to that! Now I'll browse your vids!

    • @bigwhoopgames
      @bigwhoopgames  2 місяці тому +1

      Thanks. Let me know if you'd like me to make a tutorial for any other topics.

  • @tinyfold
    @tinyfold 6 місяців тому +2

    I can't find this in stack overflow! This has been so useful in my project! Thanks so much!

  • @StreakyFly
    @StreakyFly 7 місяців тому +3

    Thank you! Neither ChatGPT nor my brain were able to achieve this haha

  • @damus6665
    @damus6665 Рік тому +3

    good tutorial, it will help me for sure!

  • @S0ggyW3tW4t4r
    @S0ggyW3tW4t4r 5 місяців тому +1

    Oh my goodness, dude, thank you so so much. I’m sure you get this a lot, but I couldn’t find anything on this, I’ve been looking into it for about three weeks by now. This was so helpful, keep up it up dude!! Also, do you think you could do a Pygame.math.vector2 tutorial? Or do you have one and I’m just blind 😅

    • @bigwhoopgames
      @bigwhoopgames  5 місяців тому +1

      I don't have one. I only have a few tutorials up.

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

    hello, in the tutorial, you are additioning tuples by just putting a + or - between them, but for me it dont work, it says that to make :
    pivot + (20,0) #for example
    i should do this
    pivot[0] + 20, pivot[1]+0
    which become more complicated when i have to additionate things like this :
    offset = pivot + (origine - pivot).rotate(-angle)
    I am really stuck and dont know how to do this... can you tell me how can i addition tuples togethers like you do ?

    • @bigwhoopgames
      @bigwhoopgames  6 місяців тому +1

      Those are Vectors, not tuples.

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

      @@bigwhoopgames Ohhh my bad i see... is it possible to make a vector from a player rect ?

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

      Yes, you could just make a pygame.Vector2(player.rect.center) or however your alignment (topleft, midbottom, etc) works.

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

    I like the gun part ima implement this in my game soon

  • @moadhoueslati6838
    @moadhoueslati6838 3 місяці тому

    instructions unclear.

    • @bigwhoopgames
      @bigwhoopgames  3 місяці тому

      What was unclear?

    • @moadhoueslati6838
      @moadhoueslati6838 3 місяці тому

      @@bigwhoopgames i couldn't understand it well especially the method "rotate_on_pivot" wish there was a quick illustration, but thanks anyways