Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


classes


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 markrodgers11   Members   -  Reputation: 149

Like
0Likes
Like

Posted 16 October 2012 - 05:49 PM

okay so recently ive been reading a book on C++ and i've learned quite a bit and i just wanted to see what it was like so i took a look at the cryengine 3 source code that they release with the SDK. and suprisingly i could KIND OF understand it xP although at the same time alot of the stuff they made was custom so there was a lot of things i was confused about but i realized when i look at source code everyone uses classes, but for some reason the book doesnt cover classes to towards the end of the book.

So I was just wondering if someone could explain how classes work in C++ and how to use them and the syntax? Basically everything i should know about classes ;p

Sponsor:

#2 Code Fox   Members   -  Reputation: 1809

Like
0Likes
Like

Posted 16 October 2012 - 06:13 PM

I would suggest reading THIS and THIS

Classes and Objects may seem confusing at first, but once you start using them, you'll like what they can do - they are very versatile.

Edited by Shippou, 16 October 2012 - 06:15 PM.

Does Anyone Actually Read This ?
 


#3 Serapth   Crossbones+   -  Reputation: 5792

Like
0Likes
Like

Posted 16 October 2012 - 06:15 PM

OK, that is a rather large bill of things to request.

Take a look at the tutorial in my sig, the coding starts in part 2, and you will see classes in action and with real world examples.

Simplest way to describe it, classes are a way of organizing your code into logical units. A class is a template or model from which objects are created ( a class is a thing, an object is an instance of a thing. For example, my car is a Hyundai Veloster. A Veloster is a class, while MY Veloster is an object ). A class can have both methods ( functions ) and variables. Access to these functions can be public, private or restricted to other classes. You can use one class to create another derived class, and this is called inheritance.

Thats the 1000 foot explanation, now go read the tutorial for actual examples.


EDIT: Added link, as if I change my sig, suddenly this post will make very little sense in the future...

Edited by Serapth, 16 October 2012 - 06:21 PM.


#4 markrodgers11   Members   -  Reputation: 149

Like
0Likes
Like

Posted 16 October 2012 - 06:17 PM

okay thanks guys!

#5 Black-Rook   Members   -  Reputation: 1563

Like
0Likes
Like

Posted 16 October 2012 - 11:34 PM

markrodgers11, the sooner you learn Classes the easier programming life becomes! Just picture programming an RPG, and you have the Enemy Class. You can use it as a template for hundreds of different enemies! It's a life saver, not to mention you can easily transfer those Classes into other projects by copying the .h and .cpp file over! If it wasn't for reusable code, I would surely go mad.
GameDev Journal: http://www.gamedev.n...-rooks-journal/

OpenChess - 1.0 done!

Classic RPG #1 - Task 9 -> January 1st 2013

#6 markrodgers11   Members   -  Reputation: 149

Like
0Likes
Like

Posted 17 October 2012 - 06:13 PM

yeah thats what i've heard and tahts why i wanna start learning how to use classes ;p ive been learning about vectors recently and those are pretty cool xP




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS