O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – Implementing the game engine

We will use the Graphics View framework to implement the board visualization. We will not provide too many details about the implementation, since we focus on scripting in this chapter. The basic skills you learned in Chapter 4, Custom 2D Graphics with Graphics View, should be enough for you to implement this game. The full code of this example is provided with the book. However, we will highlight the architecture of the project and briefly describe how it works.

The game engine implementation consists of two classes:

  • The Scene class (derived from QGraphicsScene) manages the graphics scene, creates items, and implements the general game logic
  • The Entity class (derived from QGraphicsEllipseItem ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required