Drawing the player and other sprites
Before we add the code to move the player and use all our new sprites, let’s draw them. This is so that, as we add code to update/change/move them, we will be able to see what is happening.
Add the highlighted code to draw the four new sprites:
// Draw the tree
window.draw(spriteTree);
// Draw the player
window.draw(spritePlayer);
// Draw the axe
window.draw(spriteAxe);
// Draw the flying log
window.draw(spriteLog);
// Draw the gravestone
window.draw(spriteRIP);
// Draw the bee
window.draw(spriteBee);
Run the game, and you will see our new sprites in the scene.
Figure 5.1: New sprites in scene
We are really close to a working game now.