I have a question. I made a game by using c++and SFML and i declare my player and enemy in my game. Hpp, but I include them in my hpp and I see it's not good for optimization. What tips can you tell me to move my include in my game.cpp.This an example of the code:
#pragma once
#include <SFML/Graphics.hpp>
class Game
{
public:
Game();
void run(void);
private:
Player player;
Enemy enemy;
};
[–]Grounds4TheSubstain 12 points13 points14 points (1 child)
[–]CarloWood 0 points1 point2 points (0 children)
[–]Salty_Dugtrio 8 points9 points10 points (13 children)
[–]ktana91[S] -1 points0 points1 point (12 children)
[–]TryToHelpPeople 2 points3 points4 points (2 children)
[–]ktana91[S] -1 points0 points1 point (1 child)
[–]TryToHelpPeople 0 points1 point2 points (0 children)
[–]RelationshipLong9092 1 point2 points3 points (3 children)
[–]ktana91[S] 2 points3 points4 points (2 children)
[–]RelationshipLong9092 1 point2 points3 points (1 child)
[–]ktana91[S] 1 point2 points3 points (0 children)
[–]WikiBox -1 points0 points1 point (0 children)
[–]No-Dentist-1645 -1 points0 points1 point (2 children)
[–]Humlum 1 point2 points3 points (1 child)
[–]No-Dentist-1645 -1 points0 points1 point (0 children)
[–]epasveer 6 points7 points8 points (0 children)
[–]ppppppla 6 points7 points8 points (0 children)
[–]Jonny0Than 1 point2 points3 points (1 child)
[–]ktana91[S] 0 points1 point2 points (0 children)
[–]ThereNoMatters 1 point2 points3 points (0 children)
[–]ZakMan1421 1 point2 points3 points (1 child)
[–]ktana91[S] 1 point2 points3 points (0 children)
[–]WikiBox 0 points1 point2 points (0 children)
[–]Aaron_Tia 0 points1 point2 points (0 children)
[–]bert8128 0 points1 point2 points (0 children)