Thread: getting the hang of classes.

  1. #1
    Registered User
    Join Date
    Aug 2001

    getting the hang of classes.

    hi people,

    i am starting to get a grip of object oriented programming but one query that puzzles me is say for example if I had a battleships game, what would be in my main function ultimatelty. I hope that there would be only one class declaration called battleships and that all other classes would be derived from the original one. Is this correct ?


  2. #2
    Not really.
    It pretty much depends on you on how you wanna implement it into the game.

    If it was me I had build a class for the ship which handles the drawing of it and the rest of what it needs to do.
    Then I had probably create a class Game that handles the ingame loop .

    And if you wanna shoot some monsters that basicly do the same thing like moving you create a monster class that handles what the monster actually do.

    Pretty fun and easy. You work on it slowly and you can concentrate on doing 1 class at a time.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can you Initialize all classes once with New?
    By peacerosetx in forum C++ Programming
    Replies: 12
    Last Post: 07-02-2008, 10:47 AM
  2. Multiple Inheritance - Size of Classes?
    By Zeusbwr in forum C++ Programming
    Replies: 10
    Last Post: 11-26-2004, 09:04 AM
  3. im extreamly new help
    By rigo305 in forum C++ Programming
    Replies: 27
    Last Post: 04-23-2004, 11:22 PM
  4. Exporting VC++ classes for use with VB
    By Helix in forum Windows Programming
    Replies: 2
    Last Post: 12-29-2003, 05:38 PM
  5. Prime Number Generator... Help !?!!
    By Halo in forum C++ Programming
    Replies: 9
    Last Post: 10-20-2003, 07:26 PM