ASTEROIDS in C - Raylib Tutorial Part 2

Поділитися
Вставка
  • Опубліковано 12 вер 2024

КОМЕНТАРІ • 11

  • @ayoubelmhamdi7920
    @ayoubelmhamdi7920 4 місяці тому +2

    fasting the video is acceptable for 1 or 2min, we can't continue watching 1h of that, if not necessary

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

    Hey Andrew,
    pretty nice video! Keep up the good work.
    I've got some questions: is this project open source and where do I get the ship texture from?

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

      I made the ship texture in Aseprite, and you can grab it and the source from the link in the description! I didn't provide it right away because I didn't want to spoil the contents of Part 4, but it's coming out tomorrow so I'm adding it early! (You weren't the only comment looking for the source!)

  • @alexcampbell-black8543
    @alexcampbell-black8543 Рік тому +1

    This is awesome! Quick question, why not just use Vector2Lerp for deceleration? This works pretty nicely:
    player->velocity = Vector2Lerp(player->velocity, (Vector2){ 0, 0 }, PLAYER_DECELERATION * frametime))

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

      Well that's easy, because I don't want to give away all the tricks in one video! Between Raylib and Raymath there's some super good operation style functions for sure 😁

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

    Awesome tutorial, thanks. Could I ask why you are passing the player by pointer in PlayerUpdate but by value in PlayerDraw? Is it because we don't care about modifying the player struct in place when we draw it as we just need the information to pass on to the library?

    • @andrewhamelcodes712
      @andrewhamelcodes712  Місяць тому +1

      You're pretty much on the nose: passing by pointer allows the function to modify the struct, which is something I want only Update to do. By passing a copy instead of a reference to Draw, I can enforce that.

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

      Perfect, thanks! I'm a C++ dev by day, so to achieve the same thing in that language I would pass the struct in by const reference, which as far as I am aware isn't possible in C. It's been really interesting to go through these videos and see the differences in approach between the two languages

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

    Disponibiliza para nós analisar o código..

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

      I didn't want to do this right away, as it would spoil what comes in Part 3 and 4, so it will be available on Aug. 8th

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

      I've since updated the description to include the project! Enjoy!