Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

neobie

CLASSES

This topic is 5098 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

when making a game of tic tac toe, is the whole game a CLASS, and the player and board objects? or is the board a class, and player another class.

Share this post


Link to post
Share on other sites
Advertisement
Thats a rather vague question.... But I guess it would depend on how complex you wanted a game of "tic tac toe" to be code wise.

I''d normally break something like this into support classes first and go from there (EG: A drawing class for the peices and board then the peices themselfs, and so on)


-Nate

Share this post


Link to post
Share on other sites
Usually the class is the definition, and an object is a variable (of type yourclass).
You should think of data when making OO designs, define what variables (members) and data you need, and combine them into a class with some methods to handle that data.
You can make the board a class, and the game a class with the board as one of its members.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!