I know this is very basic, but for some reason i can't seem to remember nor grasp on its approach.
I've read that, the window: "sf::RenderWindow renderWindow;" must be in the same function as the events.
However, how can i create a separate function using specific sf::RectangleShape Objects that were create in the main function?
What i mean is:
i've create a sf::RectangleShape rect(sf::Vector2f(22,22));
In the main function, however i want to call that specific rect object into another function called
void collissionDectection(){}.
How can i call for it? Or must i declare every Object and use all its arguments and members (all that mumbo jumbo) within the same function? Or should i use class? I rather use function, so any help is appreciated!
(I'm a beginner in C++, been studying and writting c++ code for over 3 weeks. However, i have previous programming knowledge, java and C#)