can only shoot one way!

Non-platform specific questions.

can only shoot one way!

Postby savvy » Tue Jun 09, 2009 7:38 am

how do you get it to shoot the way that you are facing, i have tried, but i can not work it out.
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: can only shoot one way!

Postby jimmynewguy » Tue Jun 09, 2009 8:54 am

depends on what kind of game platformer? space shooter?
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: can only shoot one way!

Postby Bee-Ant » Tue Jun 09, 2009 11:36 am

First, make a variable called "direct"
Put this code on Keydown to left
Code: Select all
direct=0;

Put this code on Keydown to right
Code: Select all
direct=1;

Put this code on Keydown to shoot
Code: Select all
if(direct==0)
{
    //put your code to shoot to left here
}
if(direct==1)
{
    //put your code to shoot to right here
}
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: can only shoot one way!

Postby savvy » Tue Jun 09, 2009 11:39 am

Ok, thanks. although, i will repost if i have any problems!
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: can only shoot one way!

Postby DST » Tue Jun 09, 2009 9:07 pm

Remember how ge starts with 0 degrees to the right?

How about you reverse those numbers - 0 for right and 1 for left.

bullet>createActor>

Code: Select all
angle=direct*180;


:P
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: can only shoot one way!

Postby Bee-Ant » Thu Jun 11, 2009 4:30 am

That won't work unless you put...
Code: Select all
angle=direct*180;
directional_velocity=10;

:P
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: can only shoot one way!

Postby Orlando911 » Mon Dec 13, 2010 7:46 pm

how can I make enemy shoot the player, in his direction,

for example, if the player move anywhere, the enemy shoot him,

so I tried to make enemy shoot in only one direction, make shoot velocity ( xvelocity = -4 ; )

but when the player move, I don know how make the shoot go to his direction ,
Orlando911
 
Posts: 84
Joined: Tue Dec 07, 2010 8:18 am
Score: 1 Give a positive score

Re: can only shoot one way!

Postby Orlando911 » Mon Dec 13, 2010 8:18 pm

thank you,

I got it from the game (moondefender),
Orlando911
 
Posts: 84
Joined: Tue Dec 07, 2010 8:18 am
Score: 1 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest