Polymorphism
Object Oriented Programming makes it easier to think about architet in software programs because we can think software as a number of different objects that interact with each other. OOP naturally breaks the program into type of objects.
We'll learn some slightly more advanced concepts of OOP.
Principle of Object Oriented Programming:
- Inheritance
- Encapsulation
- Polymorphism
- Abstraction
Let's take a review about our project.
- Map: determines the width and height boundaries of a level. It's constructed by passing it a width and height value for the map. Onmap method to determine the point on the map.
- Point: represents a coordinate on the grid, so it initialized with values for x and y. DistanceTo method have two different input parameters. One for calculate between coordinate and another method to calculate between point object.
- MapLocation: subclass of Point class.
- Exception: we make our own exception handler.
- Path: to show the path from MapLocation class.
- Invader: the object class for Invaders.
- Tower: the primary behavior is shoot to invader. It has other properties like range, power, origin coordinate.
- Main: It has different map size, run on defined path, set the invader,