Qt 2D Game Engine: Getting Started

Let me explain the bare minimum concepts behind getting your first 2D game engine up and running in Nokia’s Qt envirnoment.

By Chongchen Saelee

Input
Processing
Output
Cleanup

Input

Crucial to interactivity, your engine must be able to receive input data whether that is through a keyboard and mouse, tablet, camera, etc.

Processing

Once your engine receives the input data, it needs to process it. This can be coordinates: where to draw a certain object, detecting overlap or collision, offsetting scrolls, etc. This is the most important part of an engine.

Output

In most cases, an engine should handle the drawing of an image to the screen. And to give the illusion of motion, you will need to implement your engine to animate in an efficient way without consuming too much CPU or GPU power. There is a trade-off, however, where if your engine processes a lot of data, then there might be less drawing to the screen. Whereas, if you want it to animate smoother, you’ll have to process less data or variables. The least acceptable framerate seems to be around 16 frames per second, although 30 is the standard.

Cleanup

All that data has to be cached or buffered into your RAM or hard drive, so make sure you optimize your engine to cleanup after every processing loop.

Tags: , , , , , , , , , , , , , , ,

Comments are closed.