Abstract
In this chapter, we are going to look at the similarities between the different types of game objects and how we can express these similarities in C#. The main technique used for this is inheritance. Inheritance is a technique that is used to structure related classes in a hierarchy. We will show how to override methods in a subclass to provide specific behavior for that class. We will deal with access modifiers for class members. We will also introduce the concept of polymorphism, which allows calling the right version of a method automatically.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer-Verlag GmbH Germany, part of Springer Nature
About this chapter
Cite this chapter
van Toll, W., Egges, A., Fokker, J.D. (2019). Organizing Game Objects. In: Learning C# by Programming Games. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-59252-6_10
Download citation
DOI: https://doi.org/10.1007/978-3-662-59252-6_10
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-662-59251-9
Online ISBN: 978-3-662-59252-6
eBook Packages: Computer ScienceComputer Science (R0)