finding the location of a tile by a index is as simple as int spritesheet_col = sprite_index % total_sprites_in_row; int spritesheet_row = (int)sprite_index / total_sprites_in_row; there is tons left but it is a reasonable-ish start for series The only thing I really don't like is how you conceptualize triggers doing it by x,y cripples your game design to hard coded locations. Instead use a trigger struct... something like when you move test if a tile has a trigger and act accordingly struct { trigger_type // ie combat, teleport, interact object_id // whatever object id be it a mob or different level etc } I only bring this up as you said it is a comprehensive guide
fair points! And yes, it's definitely not an ideal approach to hardcoding locations. Definitely something I'm planning to return to. I like that idea of a trigger. Helps with maybe layering triggers when necessary. What I am trying to avoid is falling into an "engine trap". So at times there may be decisions that reflect that. Thank you so much for the input though, I appreciate it!
I appreciate you taking the time to make these projects. When I was looking into raylib, it was hard to find resources. I found a tutorial here and there, but a lot of people (myself included) learn best by creating a project from start to finish. I will say, I'd like to better understand how to create headers/source files and break the project into chunks but that may be beyond the scope of these tutorials
Thank you so much! That's a great idea -- I think my projects are getting to the size where I'm gonna HAVE to do that in order to keep some kind of structure and legibility. I'm sure someone doesn't want to watch a video where I'm just scrolling a giant main file to find function blocks. Appreciate the feedback and good luck on your own Raylib projects!
Great tutorial, im following along using C++ since I want to use some of its features even if most of the code is actually C. I've done a few changes to your implementation, mostly about some data structures I thought would be more convenient. to use (like I have a Vector2i to store integer vectors). Right now Im working on the zone transitions, my approach was a bti different form yous, because I didnt want to follow your tutorial strictly. I will share my code later when im done.
please do! yeah -- I'm not entirely "happy" with how I'm handling zones. That kind of data might be neater tucked into a pure virtual type of collection...
@@ErikYuzwaI just used a string flag for different zones, of course, it would be cumbersome if I had say, 15 different zones with different state, but but something this small and simple, it will do. maybe when im finished I can think of a more robust solution.
no real "reason" really other then just getting this idea out there. Functions and logic definitely should be broken out into their own modules. Trying to plan out a "part 2" here which would include that
I had a real fun time putting this little project together! Hope y'all enjoy it, and use it as inspiration to make something of your own! 🔥🔥
I love finding tutorials like these
thank you so much! I'm so happy you came across it!
Thanks, I learnt a lot. Making a game using a library, especially making RPG is really complex.
definitely complex - I have a lot of ideas for followups, but just trying to organize them into something coherent. heh.
finding the location of a tile by a index is as simple as
int spritesheet_col = sprite_index % total_sprites_in_row;
int spritesheet_row = (int)sprite_index / total_sprites_in_row;
there is tons left but it is a reasonable-ish start for series
The only thing I really don't like is how you conceptualize triggers doing it by x,y cripples your game design to hard coded locations. Instead use a trigger struct... something like when you move test if a tile has a trigger and act accordingly
struct
{
trigger_type // ie combat, teleport, interact
object_id // whatever object id be it a mob or different level etc
}
I only bring this up as you said it is a comprehensive guide
fair points! And yes, it's definitely not an ideal approach to hardcoding locations. Definitely something I'm planning to return to. I like that idea of a trigger. Helps with maybe layering triggers when necessary. What I am trying to avoid is falling into an "engine trap". So at times there may be decisions that reflect that. Thank you so much for the input though, I appreciate it!
I appreciate you taking the time to make these projects. When I was looking into raylib, it was hard to find resources. I found a tutorial here and there, but a lot of people (myself included) learn best by creating a project from start to finish. I will say, I'd like to better understand how to create headers/source files and break the project into chunks but that may be beyond the scope of these tutorials
Thank you so much! That's a great idea -- I think my projects are getting to the size where I'm gonna HAVE to do that in order to keep some kind of structure and legibility. I'm sure someone doesn't want to watch a video where I'm just scrolling a giant main file to find function blocks. Appreciate the feedback and good luck on your own Raylib projects!
Great tutorial, im following along using C++ since I want to use some of its features even if most of the code is actually C.
I've done a few changes to your implementation, mostly about some data structures I thought would be more convenient. to use (like I have a Vector2i to store integer vectors).
Right now Im working on the zone transitions, my approach was a bti different form yous, because I didnt want to follow your tutorial strictly. I will share my code later when im done.
please do! yeah -- I'm not entirely "happy" with how I'm handling zones. That kind of data might be neater tucked into a pure virtual type of collection...
@@ErikYuzwaI just used a string flag for different zones, of course, it would be cumbersome if I had say, 15 different zones with different state, but but something this small and simple, it will do.
maybe when im finished I can think of a more robust solution.
Thanks a lot. I'm learning Raylib with Go, following along this tutorial was a great way to learn the basics.
oh man that's rad - I'm really glad to hear it's helping. Thanks for stopping by and best of luck with Go!
Awesome. Just what I needed.
thanks so much! Happy to hear it helped!
thanks for this
thanks so much - no problem at all. Just hope it helps!
great video!!
thank you so much! Appreciate it
can u do more of this videos pls
definitely - definitely - trying to figure out how to grow this one a bit more. Any suggestions?
@@ErikYuzwa animations while walking and fighting would be great
Is there a reason you keep all the logic within a single file, rather than spread it out?
no real "reason" really other then just getting this idea out there. Functions and logic definitely should be broken out into their own modules. Trying to plan out a "part 2" here which would include that
@@ErikYuzwa Happy to hear, this tutorial was a great help getting started using raylib.
@@tobiaskipp3188 thanks a lot! I'm glad to hear it's helped out!