As an in-world entity, the Player must become a Node to inherit its Update and Draw methods. Instead of directly manipulating the sprite's position, the player's transform will now handle world translation, and the sprite will be drawn at the player's transform. Since the player resides at the scene tree's root, its local transform directly mirrors its global transform.
game/player.h
// -----#include "engine/node.h"// Add: Include.namespacegame{classPlayer:publicng::Node{// Add: Inherit from Node.public:Player(ng::App*app,constng::Tilemap*tilemap);// --- Change: Instead of having a public Update and Draw, override the node's methods. ---protected:voidUpdate()override;voidDraw(sf::RenderTarget&target)override;// --- End ---// -----private:ng::App* app_ =nullptr;// Remove.};}// namespace game