Page 2 of 2

PostPosted: Wed May 09, 2007 4:54 am
by Fuzzy
Yeah, that compiles fine Sparky, but if I do this:

if (x==10) if (y==153) textNumber = x+y;

...I have followed your rule. (I know there is a cleaner way to write that. It is an example for illustrative purposes).

That doesnt look quite right? What do you think the GE compiler would do if it encountered that? It might work.... but its not really kosher, you know?

Being vague in your coding is a great way to confuse the compiler. Going that extra step doesnt add anything to the final size of your game, nor unduly affect play speed.

Why are all my posts about 'if'? I'm totally obsessed with it or something..

PostPosted: Wed May 09, 2007 4:56 am
by Sgt. Sparky
your signature wrote:Mortal Enemy of IF....

:D
:lol:

PostPosted: Wed May 09, 2007 8:51 pm
by AnimeTank
So can you guys rap this up for me?

For my main actor, i type what...

And for the bullet, what...

PostPosted: Thu May 10, 2007 12:06 am
by Sgt. Sparky
okay,
just make the variable called DIR (Make it a global)
and add this for a draw actor event for the player,
Code: Select all
char*key=GetKeyState();
if(key[KEY_LEFT] == 1)DIR = 0;
if(key[KEY_RIGHT] == 1)DIR = 1;

and for the create actor event for the bullet put,
Code: Select all
if(DIR == 0)xvelocity = - 10;
if(DIR == 1)xvelocity = 10; 
.
that is all. :D