Ok, thanks for the help, you guys are awesome. Can I ask one more question?
I have 3 structures like this:
skill_t skills; // array of skills
int skills_count; // how many skills does he have
So, it seems like there's a lot of duplicated data above. How would you guys go about "fixing" that? Or should I just leave it as is and not care about this?
And, on the enemy_t structure, is that a dumb way of handling enemies with different skills/skill counts?
There is, in my opinion, nothing wrong with duplicated code. The main thing to Think about here, is to not overcomplicate things to make it "pretty". It will just bite you in the ass.
You could ofcource do nested structs, like they all contain x and y and velocity and so on. But nested structs is more annoying to work on, and you work on them alot. You use them way less.
BUT, this is, as I see it still OOP. Your structs is obviosly designed as object. This is fine if you handle 100 object, or 1000 or (some number), but if you will handle a big number of "objects", it will be slow.
I would think about how data is USED. Most likely you will make a function that updates ALL objects x and y.
Then I would do:
double x; (by the way, why doubles?)
Then the same for w+h. Then an array for textures, and so on. Thts way you will get a much more efficient engine, with less cache misses.