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 the sprites, 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); 
 
// Draraw 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.

Drawing the player and other sprites

We are really close to a working game now.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.255.145