|
-
Jan 28th, 2003, 10:52 PM
#1
Thread Starter
Addicted Member
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
-
Jan 29th, 2003, 12:13 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|