Since we are going to create a new class for the main character, we will remove the code pertaining to the player character in the main file. Let's learn how to do this.
Remove all player-related code from the main.cpp file. After doing this, the file should appear as follows:
#include "SFML-2.5.1\include\SFML\Graphics.hpp" sf::Vector2f viewSize(1024, 768); sf::VideoMode vm(viewSize.x, viewSize.y); sf::RenderWindow window(vm, "Hello SFML Game !!!", sf::Style::Default); sf::Vector2f playerPosition; bool playerMoving = false; sf::Texture skyTexture; sf::Sprite skySprite; sf::Texture bgTexture; sf::Sprite bgSprite; void init() { skyTexture.loadFromFile("Assets/graphics/sky.png"); skySprite.setTexture(skyTexture); bgTexture.loadFromFile("Assets/graphics/bg.png"); bgSprite.setTexture...