Hi everyone! I need help with my current game. It is may first game, so I have a lot of new ideas. But I have a problem dealing with event listeners. The listeners need to know a lot of variables that exists inside main. But they are a different function, of course. My question is: How can I acess the main variables using another method, without having to use they like parameters.

I could use globals, but when I talk variables I mean a lot of them.
The only thing that "looks like"(damn!! sorry for the bad english) is the friend key word. I´m so sad...
One interesting thing: everyone knows that when inline function are used, the code is, actually, coppied to the position of the call, but I think that this is useless.

An example of the horrible thing I´m trying to do;

int main(){
int an_int;

//do something with an_int

f();

return 0;

}

void f(){

//do more things with an_int

}

Thanks for any help!!!