Results 1 to 2 of 2

Thread: Class

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    174

    Class

    Hi All,
    Anyone give me a detailed description about CLASS. Till now i didn't used class in my projects. What r its advantages. Pls explain how can i apply it.
    Thanks in Advance

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    OK, so because you are in the game forum, I will take it that way. Think of a game, a space shooter game. You will have a lot of enemies. They look a bit different from each other, but they have a lot of things in common. So you can use a class to store all the variables and methods for a space ship in a class. Variables can be X, Y coordinates, or speed, or anything you need to store about a spaceship. Methods can be to shoot or move in a special way or anything you need.

    Now you can make instances of that class. All your instances has the same variables and methods, but you can give the variables and methods different data, so all the space ships look/act different.

    Classes is just to simplify things, and can save you a great deal of work...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width