Game advice

Discussion in 'C++' started by Lesshardtofind, Aug 31, 2010.

  1. Lesshardtofind

    Lesshardtofind New Member

    Aug 31, 2010
    Likes Received:
    Trophy Points:
    Hey, I'm working with a side scroller in SDL... things are flowing pretty smoothly, enemy behavior, levels, object interactions, but I'm now working to add 30 new weapons to the game. I first thought about a weapon class, but realized each weapon would have different characteristics. I am not quite sure if I should make a weapon class with common variables then make a subclass for each of the 30 weapons, but that didn't really make sense to me because I'd never use the weapon class by itself so it almost seemed useless. I haven't done any subclasses yet so I'm not familiar with how they are defined called ect. The only other option I see is just creating 30 individual classes. I thought about also making these only called within the character class attack function, but it might be useful to use in other ways... say equiping enemies/bosses with any of the 30 weapons later if I want. Any opinions on how you would impliment this? I dont' really need code examples (unless you want to show me an example of creating a subclass lol), I'm just looking for tips of the best direction to start in so I don't write a ton of code and decide its useless when I'm done lol. Thanks again for your time.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice