Declaring multiple object pointers on one line causes compiler error

sf::Sprite* re_sprite_hair, re_sprite_body, re_sprite_eyes; Does not declare 3 pointers – it is one pointer and 2 objects. sf::Sprite* unfortunately does not apply to all the variables declared following it, just the first. It is equivalent to sf::Sprite* re_sprite_hair; sf::Sprite re_sprite_body; sf::Sprite re_sprite_eyes; You want to do: sf::Sprite *re_sprite_hair, *re_sprite_body, *re_sprite_eyes; You need to put one … Read more

How to make an Smooth Movement in C++, SFML

Because many other programmers might want to know that, here it is, but next time ask a more precise question Here’s my way to make a smooth movement: Take your initial movement, lets say 25, 15 per second Make a loop like this: void GameEngine::GameLoop() { sf::Clock timer; sf::Time tickRate; sf::Vector2f movement(25.0,15.0); // Your movement … Read more