Page 1 of 1

shooting diagonally

PostPosted: Thu Oct 18, 2007 7:49 am
by elite
i just have a teeny weenie question, how do you shoot diagonally?
is it sumthing like
Code: Select all
yvelocity = 8 xvelocity=5

I aint sure, but it would be helpful if this was answered....
I promise you, that the alpha test of "Arbiter's Adventure" is on the way!

Re: shooting diagonally

PostPosted: Thu Oct 18, 2007 8:52 am
by Spidy
wait!! there is a topic where kalladdolf gave me gun demo plz wait!!

Re: shooting diagonally

PostPosted: Thu Oct 18, 2007 8:53 am
by Spidy

Re: shooting diagonally

PostPosted: Thu Oct 18, 2007 9:08 am
by elite
is this the one where it shoots towards your mouse because thats not what i had in mind......
i need a tank sort of thing (btw it IS an ENEMY) to shoot diagonally in to the sky (i will add gravity to the bullet)

Re: shooting diagonally

PostPosted: Thu Oct 18, 2007 9:10 am
by Spidy
THINKING!!!!!!! :?you mean gravity come in to enemys bullets

Re: shooting diagonally

PostPosted: Thu Oct 18, 2007 9:15 am
by Spidy
sorry sorry just a minute plz

Re: shooting diagonally

PostPosted: Thu Oct 18, 2007 9:19 am
by Spidy
maybe gravity404 game will help ya :o

http://game-editor.com/forum/download.php?id=962

Re: shooting diagonally

PostPosted: Fri Oct 19, 2007 1:05 pm
by tufif
So you want it to launch like a cannon?
Maybe something like this
Code: Select all
xvelocity = -8;
yvelocity = -8;

Use that on the bullet when you first create it, then on each draw actor do this:
Code: Select all
yvelocity += 0.8;

That works on jumping, so it should work on bullets too. Then just put in your collision code for whatever you want it to do. I'm not at home right now so I can't test the code or try different numbers, but I that should at least get you started.