Question

Using short answer, please explain what benefits does inheritance bring to game programming. Also, how does polymorphism expand the power of
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Inheritance means the ability of a class to have a feature of the parent class.

How can it you useful in gaming?

Inheritance reduces code redundancy between similar objects by putting similar objects in the commonplace.

Example: In any Game, we have several, characters.

So we have one parent class having properties like how it will walk, jump, kill, etc.

We can inheritance this class to have all these features, plus we can add some new feature to this child class for a particular character like its color, shape, etc.

In the similar fashion, we can create several characters.

Polymorphism
It is an ability to send a message to in different forms.

Absolutely polymorphism go hand in hand with inheritance
It enables child class the ability to override the properties of parent class, which suits the child class.



Add a comment
Know the answer?
Add Answer to:
Using short answer, please explain what benefits does inheritance bring to game programming. Also, how does...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT