Polymorphism

Polymorphism is a concept that exists in object-oriented programming. It is associated with inheritance. What polymorphism refers to is the use of inheritance to create one object with multiple forms. For example, there are three objects in Java, since Game Maker does not directly allow polymorphism. Object A is the main object, and Objects B and C extend Object A. This is essentially the same thing as making Object A the parent of Objects B and C in Game Maker. There is a method that accepts Object A as an argument. Since Object B extends Object A, Object B can be given as the argument. Perhaps Object B has overwritten something in Object A. This means that something different will happen than what would happen if an instance of Object A was given as an argument. If Object A was a basic enemy in a game, then Objects B and C would be an extension of a basic enemy; perhaps they would contain information regarding the look, strength, and attack of the enemy. This information would be present in Object A under most circumstances, but in a very basic form. This is essentially how polymorphism is used in programming and game development. While Game Maker does not directly support polymorphism, it is implemented in a slightly different fashion. In a room, objects can be placed. In a game, there are perhaps ten objects. Any of these ten objects can be placed in the room because they are all objects.