DeVry GSP 125 Week 5 Discussion 1 & 2 latest

$12

Quantity:

Description

DeVry GSP 125 Week 5 Discussion 1 & 2 latest

dq 1

Virtual Functions (Graded)

  • What are virtual functions? How do you use them in game design?
  • What is an interface (also called an abstraction)? What does it have to do with polymorphism and virtual functions?
  • What is a pure virtual function? What is its purpose?
  • Find a game on the Web.What kind of classes do you think it would use in its code?
  • Imagine you have a puzzle game in which pieces can be groups of connected blocks and/or tiled images and can be used in the same game at the same time.In this example, I would want a base class that makes a virtual draw, rotate, collide, and probably getType as well. Below is an example.
  • classPuzzlePiece {• public:• virtualvoid draw()=0;• virtualvoid rotate(int a_direction)=0;• virtualbool isColliding(PuzzlePiece* p)=0;• virtualint getType()=0;

};

What kind of game might this PuzzlePiece class fit in?

dq 2

Polymorphism (Graded)

  • Can you give an example of where polymorphism would be used or where it would be useful?
  • Are there any downsides to using polymorphism?
  • Does anyone know how polymorphism (dynamic dispatch) can be done in pure C?
  • How does dynamic_cast work? Are there any downsides to using dynamic_cast?

 

DeVry Courses helps in providing the best essay writing service. If you need 100% original papers for DeVry GSP 125 Week 5 Discussion 1 & 2 latest, then contact us through call or live chat.

DeVry GSP 125 Week 5 Discussion 1 & 2 latest

Best DeVry GSP 125 Week 5 Discussion 1 & 2 latest

DeVry GSP 125 Week 5 Discussion 1 & 2 latest