Activity
Mon
Wed
Fri
Sun
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
What is this?
Less
More

Memberships

Ooga Booga Game Devs

3.1k members • Free

10 contributions to Ooga Booga Game Devs
Following along on RayLib
I just finished day 4 the Tile System, have been following along via raylib instead as I daily drive a Mac and my PC's not always available to me (hey we make do with the cards we have right?). General feel is that RayLib feels mostly the same to what I see on Ooga Booga. So definitely no issues following along. Has been a great exercise for me so far! Anyways, just wanted to point out that because RayLib uses source and destination Rectangles to draw the sprites, the destRect itself is already kinda like a range in itself. So you don't actually need to write range.c, and can just use the CheckCollision functions (https://www.raylib.com/cheatsheet/cheatsheet.html). The bounding range data itself is kinda encapsulated in the destRect already. Also GetMousePosition defaults to (0,0) even if the mouse isn't even active yet. So I did a 0,0 check (since it'll 99.999% not be 0,0 again once you start moving it cause floats) and cached that as a bool to check against for all the range or collision checks with the mouse. That way you don't have things highlighted in the top left corner of the window everytime you launch. Also, say hi if you're working on a Mac! So we can connect and help each other troubleshoot as we follow along! Esp if you're using raylib to follow along.
0 likes • Aug '24
@Michael Negre Yeah I put it off for a while, but glad to have finally got around to it. Even have my own little template project now after running it on both mac and windows.
1 like • Sep '24
@Willis Plummer Yeap pretty much what Charlie has replied. Memory arenas are the way to go. But I haven't spent time to make it yet. Cause I haven't had the need for it yet. I would say if you're really not too familiar, don't let it stop you from moving on. Just malloc/calloc, and call free at the bottom. (even if you don't usually it would automatically free anyway OS side but still good practice). Then when you're more confident, you can try implementing your own basic memory arena.
Z-sorting on RayLib?
I'm on day 8 of the course now, As seen in the community, some of us are following along using RayLib (for variety of reasons, mine is I daily drive a mac) As far as I know RayLib doesn't have any built in z-sorting support. So whatever order you render things is what you get. Am wondering for those using or have used RayLib, what methods or systems do you use to handle z-sorting? More of a discussion than a question.
1 like • Aug '24
@James Roberts Yeah thanks for that! I've done my own z sorting before for particles in OpenGL with GLUT. What you said is very true, about data manipulation and how important these algorithms can be. Am more curious about what other people's approaches are to layering, how are they storing that layering information. For example, your two layer system, do you just have two "entity" arrays in your world? and render one first before the other? But then that adds complexity to whenever you want to iterate over everything for physics checks for example. Or did you put everything into one world->entities arr and then just loop through it twice, checking for a layer flag before rendering, etc. Things like that I want to hear how others have done it!
0 likes • Sep '24
@Oleksandr Melnichenko Coool! Thanks for sharing this! Btw what language is this? I don't recognise the syntax.
Raylib screen position to world position
If you're using Raylib instead of Ooga Booga, and want to get the world position from your cursor for example, this may be of use: Vector2 screen_position_to_world_position(Vector2 screen_position, Camera2D camera) { Vector2 world_position = (Vector2){ .x = (screen_position.x / camera.zoom) + camera.target.x - (camera.offset.x / camera.zoom), .y = (screen_position.y / camera.zoom) + camera.target.y - (camera.offset.y / camera.zoom), }; return world_position; } Edit: As @Alperen Yilmaz pointed out, you could also use the function GetScreenToWorld2D that comes with Raylib.
0 likes • Aug '24
@Alperen Yilmaz ooooo thanks for this!
0 likes • Aug '24
@Steven Star perhaps I should skim through the list of functions in the Raylib CheatSheet again…
I might have stepped into something way bigger than me
Hi, as the title kind of suggests, i might have stepped into something way bigger than me (or specifically my programming knowledge), im no way near an intermediate-advanced programmer. I have done a bunch of C++ programming back in highschool mixed with a little bit of Java, then it progressed into a Junior Java backend developer (with very little experience) and then finally here i am trying to learn and figure out graphics/game programming. I'll just say that my progress so far was just being able to setup a project, make it work and being able to create a window with a background color and a nice orange triangle, which is basically nothing compared to what this group "requires" and provides considering i'm trying to use C++ (eventho im probably learning it as if it was C). What do you guys think? Is it fine for me to just hang around and learn new stuff? Or should i just step off and focus on something less challenging?
1 like • Aug '24
I'd say you're at a good starting point. Keep the course! Know how to ask around for help! The more you try and the more you fail the more you learn. There's also a bunch of resources out there for c and cpp. One of the perks being one of the oldest yet commonly used languages out there. Also, WITH A LARGE PINCH OF SALT, you can also try using ChatGPT to assist. Especially for the small things like "how to format a string in c". Speeds up sometimes, BUT do double check whatever code is spit out. And make sure you learn and understand it at the end of the day. It can be slow but that's okay, if you speed through without learning something then you're just the same level where you are. But if you learn 10% of something new, you're on the right track already. Rinse, repeat, reap. 🤗
1 like • Aug '24
@Riccardo Famà I respect that. I'm mostly anti AI. But I use it to quickly spit out sample code for the simplest of things when I can't rmb them. Definitely something to use with caution. And that's definitely a way to go, not using code generated, but typing it yourself to make sure you really learn. You can do it!
Thoughts on RayLib?
Just started looking at the Ooga Booga engine, and it reminded me a bit of RayLib (If you aren't familiar, RayLib is pretty similar, a C Framework for making games) Has anyone here used both? I'm curious what the differences are in terms of features/goals for the engine.
0 likes • Aug '24
I'm following along using RayLib. It's been great so far, mostly similar to what I've seen. Just slight differences, but the slight differences help me to think while following along rather than just blindly copying whatever Randy types. But I think it's worth using Ooga Booga! I'm only on RayLib mainly cause I'm on a Mac. I think for THIS course, use Ooga Booga, unless platform wise you're unable to like me, then RayLib is a completely viable alternative to follow along.
1-10 of 10
Rayner Tan
3
37points to level up
@rayner-tan-7616
Game Programmer

Active 439d ago
Joined Jul 9, 2024