ABSTRACT

Object-Oriented Programming (OOP) is a technique that programmers use to help divide projects up into more understandable and maintainable pieces. This chapter discusses the concept of OOP and introduces to classes—which are a sort of template programmers can build and use to create multiples of the same C# object in their game. In OOP, objects are the base of everything. Objects possess two important characteristics: They hold states and perform behaviors. In programming, classes create the basis for objects. Classes are the blueprint or template for programmers objects. Adding methods to programmer's class gives it repeatable actions—without having to rewrite code each time they want to use the behaviour. Constructors are specialized methods. In OOP, they are called when an object is created. Access modifiers change how and when certain members are alterable. Access modifiers can help simplify programmer's code as well. Protected fields can be thought of as a combination of private and public.