C++ Game Dev 0: Introduction
This is the first of a number of tutorials that will guide you through the development of a complete, full-featured game engine.
This is the first of a number of tutorials that will guide you through the development of a complete, full-featured game engine.
In the first tutorial we will create our initial game loop and display our first window.
We Load an image from a file and draw it on-screen. We also briefly discuss platform-dependent code.
We build on our previous work and write the code that will move our Viking around the window. We’ll make sure to do this in a way that ensures the sprites movement speed will be the same (or very similar) irregardless of the hardware used to run our game.
We delve into the world of bits and bitwise operations. We create a bitmask class that we will make use of shortly in our game engines input system.
We begin to write our Input manager. We record keyboard input and how we can differentiate between a key that has just been pressed or has just been released.
We create a scene management system for our game engine. A scene will contain the logic for a specific part of our game e.g. the main menu, game, and pause scenes.
If you’ve been following the tutorials up to this point, you’ll have a sprite that you can move around the screen using the keyboard. While this is a good start; we will, in the not too distant future, want to add additional functionality to our player object. At the very least we will want our player to have health, physics, a bounding box for collisions, and a way to animate its sprites. This is where the component system comes in, the focus of todays and next weeks tutorial.
In this tutorial we will re-implement the movement code that we previously used to move our sprite around the screen, but this time as a component. We’ll also create a transform component that will be attached to all of our games objects. This component will store the sprites position, rotation, and scale (although it will only store its position initially).
As games become more complex, the issue of how to manage a games assets and resources is only becoming more difficult; which is why, even though we do not have many resources at the moment, it is a good idea to start the groundwork on what will become a robust and generic (it can handle any resource we throw at it) resource management system.