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!)
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))
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 😁
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?
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.
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
fasting the video is acceptable for 1 or 2min, we can't continue watching 1h of that, if not necessary
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?
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!)
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))
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 😁
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?
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.
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
Disponibiliza para nós analisar o código..
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
I've since updated the description to include the project! Enjoy!