Updating the game engine to use Thomas and Bob
In order to be able to run the game and see our new characters, we have to declare instances of them, call their spawn
functions, update them each frame, and draw them each frame. Let's do that now.
Updating Engine.h to add an instance of Bob and Thomas
Open up the Engine.h
file and add the following highlighted lines of code:
#pragma once #include <SFML/Graphics.hpp> #include "TextureHolder.h" #include "Thomas.h" #include "Bob.h" using namespace sf; class Engine { private: // The texture holder TextureHolder th; // Thomas and his friend, Bob Thomas m_Thomas; Bob m_Bob; const int TILE_SIZE = 50; const int VERTS_IN_QUAD = 4; ... ...
Now, we have an instance of both Thomas
...