Page 1 of 1

scope of Global variables not so Global?

PostPosted: Nov 8, 2005 @ 11:53pm
by jeemigdepeemig

Re: scope of Global variables not so Global?

PostPosted: Nov 9, 2005 @ 3:17am
by Andy

PostPosted: Nov 9, 2005 @ 9:46am
by Conan

PostPosted: Nov 9, 2005 @ 10:40am
by jeemigdepeemig

PostPosted: Nov 9, 2005 @ 11:34am
by Conan

PostPosted: Nov 9, 2005 @ 11:39am
by jeemigdepeemig

PostPosted: Nov 9, 2005 @ 11:56am
by Conan

PostPosted: Nov 10, 2005 @ 5:50am
by BradK3

PostPosted: Nov 10, 2005 @ 12:21pm
by jeemigdepeemig
Hey Brad,

I tried what you suggested but I get a: "syntax error : missing ';' before identifier 'game'" in the extern HekkusSample game; line.

Even so, is this is a good way (maybe the only way) to access a variable from an outside file? From what i've understand the compiler will not allocate memory for the variable. Which sounds not so good performance wise (since the variable is a huge game object).

Thanks for looking at my problem. I send Conan my zipped project and he's looking at it right now. It seems like a great rescourse for me this forum :) .

Greets,
jeemig

PostPosted: Nov 10, 2005 @ 2:21pm
by Conan
For completeness here's what I suggested via email:-
pass the map variable in to the sprite's move function when the sprite move function is called.
This seems the correct way to do this and I now have the code working and a little guy walking on the screen of my X51v.

PostPosted: Nov 10, 2005 @ 3:23pm
by jeemigdepeemig

PostPosted: Nov 11, 2005 @ 5:41pm
by BradK3
Great! Glad you got it working!

-Brad