Switching directions for bullets

Non-platform specific questions.

Postby Fuzzy » Wed May 09, 2007 4:54 am

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..
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby Sgt. Sparky » Wed May 09, 2007 4:56 am

your signature wrote:Mortal Enemy of IF....

:D
:lol:
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby AnimeTank » Wed May 09, 2007 8:51 pm

So can you guys rap this up for me?

For my main actor, i type what...

And for the bullet, what...
Current Projects:

Some game about some guy... :)

Message me if you have an XboxLive account. Then send me a Friend Request to my Gamertag, AnimeTank.
Message me if you have a WoW account. Then tell me what server your on, along with your name.
User avatar
AnimeTank
 
Posts: 96
Joined: Sat May 05, 2007 10:37 pm
Location: At my House, on my computer, in my seat
Score: 13 Give a positive score

Postby Sgt. Sparky » Thu May 10, 2007 12:06 am

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
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest