View
72
Download
0
Category
Preview:
Citation preview
Unit 71 – Object Oriented Design for Computer Games.
Outcome :- 01 – Understand the purpose of OOD for games.02 – Understand OOD Elements.03 – Understand OOD Modeling.04 – Be able to use OOD modeling technique to design a game element.
Object Oriented Design
• A game design based Object Oriented Principles.
• Object Oriented Principles are,– Simplified Understanding.– Reusability.– Maintenance.– Efficiency.– Real-world.
OOP - Simplified Understanding
• Completely readable as english sentences.• Example
Variable enemy as GameObject.i.e. var enemy : GameObject;
Enemy’s health decreases by 15.i.e. Enemy.health -= 15;
• Code with reusability in mind.• Never, ever copy and paste code.• Find a general implementation and reuse
- Function and class templates.
OOP - Reusability
Classes, Objects, Inheritance
• Classes :– An association of data structure with the
attributes and function that acts on the data.
• Object :– Objects is created based on a class i.e. instance of
a class.
• Inheritance:– The ability for a class to extend or override
functionality of base class.
• The ability to protect some components of Object from the external use.
Encapsulation
• The ability to create a variable, a function or an object that has more than one forms. i.e. Function Overriding.
Polymorphism
Recommended