The Daily Click ::. Forums ::. Klik Coding Help ::. 360 Shooting problemo
 

Post Reply  Post Oekaki 
 

Posted By Message

renneF



Registered
  02/08/2003
Points
  672
20th January, 2007 at 07:11:23 -

HEY

Okay, I'm trying to make a 360 degree shooting engine thing, but theres a problem.
My code to set the position of the bullets;

X( "bullet" )+Cos(Alterable Value A( "bullet" ))*(Alterable Value B( "bullet" ))
Y( "bullet" )+Sin(Alterable Value A( "bullet" ))*(Alterable Value B( "bullet" ))

Where Value A is angle, Value B is speed.

The problem is the lower the speed the bullet is shot at,(below ~100*Value B speed) the less directions it's fired in.
Basically the lower value B is, the less directions the 360 degree shooting has.
This is probably really simple.

Thank yew.

Image Edited by the Author.

 
Image

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
20th January, 2007 at 07:43:43 -

Ah, I know what the problem is. Try this instead:

- Bullet: Set value C to X( "bullet" )+Cos(Alterable Value A( "bullet" ))*(Alterable Value B( "bullet" ))
- Bullet: Set value D to Y( "bullet" )+Sin(Alterable Value A( "bullet" ))*(Alterable Value B( "bullet" ))
- Bullet: Set X position to Alterable Value C("Bullet")
- Bullet: Set Y position to Alterable Value D("Bullet")

 
n/a

renneF



Registered
  02/08/2003
Points
  672
20th January, 2007 at 07:59:38 -

Thanks for the response, but that dosen't seem to work.
I'll start fresh, can you tell me the proper method of doing 360 degree shooting?

 
Image

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
20th January, 2007 at 08:02:36 -

It works perfectly for me. Oh wait, you're using TGF, right?

 
n/a

renneF



Registered
  02/08/2003
Points
  672
20th January, 2007 at 08:06:18 -

Yeah, but I've got all my old code in there too.
I'm using MMF2 here
Will what you said before work on its own, without my method?
Cheers

 
Image

renneF



Registered
  02/08/2003
Points
  672
20th January, 2007 at 08:36:57 -

Alright, I started again and used your method.
It's exactly the same, the number of angles scales with the bullet speed.
Lower speed=less angles.
What's going on?

Image Edited by the Author.

 
Image

AsparagusTrevor

Mine's a pint of the black stuff

Registered
  20/08/2002
Points
  2364

Game of the Week WinnerHas Donated, Thank You!VIP MemberEvil kliker
20th January, 2007 at 08:56:47 -

Seeing as you're using MMF2, try using the Vector movement for the bullet, it's makes using angles and fast speed easy.

 
Image

renneF



Registered
  02/08/2003
Points
  672
20th January, 2007 at 09:10:58 -

How do I use vector movement, is it a plugin?


 
Image

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
20th January, 2007 at 09:22:04 -

Or just try forcing MMF to work with decimals with:

X( "bullet" )+Cos(Alterable Value A( "bullet" ))* 50.0

 
n/a

Werbad



Registered
  18/09/2002
Points
  235
20th January, 2007 at 10:30:36 -

As far as i know positions cannot have decimals. But then i don't have MMF2, might be different...

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
20th January, 2007 at 11:38:33 -

I meant:

Bullet: Set value C to X( "bullet" )+Cos(Alterable Value A( "bullet" ))* 50.0

<_<

 
n/a

»xerus



Registered
  28/06/2002
Points
  675

You've Been Circy'd!Game of the Week Winner
20th January, 2007 at 14:08:02 -

If you're using MMF2 just save yourself the trouble and use the Vector movement. Just go to the frame editor, click your bullet, give it the movement vector. Then throw the "Clickteam Movement Controller" (or something like that) object into your frame, and use that to control your bullets.

 
n/a

renneF



Registered
  02/08/2003
Points
  672
20th January, 2007 at 20:50:31 -

Never heard of vector movement before.
Where can I find this "Clickteam Movement Controller" ?
And how do I assign a movement vector :S



 
Image

renneF



Registered
  02/08/2003
Points
  672
20th January, 2007 at 21:43:28 -

I managed to get around the problem by using the circular movement with the Gwerdy movement pack, but its kind of complicated.
I'm sure there's a way to do it without any extensions...

Image Edited by the Author.

 
Image

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
21st January, 2007 at 07:47:00 -

Did you try:

- Bullet: Set value C to X( "bullet" )+Cos(Alterable Value A( "bullet" ))* 50.0
- Bullet: Set value D to Y( "bullet" )+Sin(Alterable Value A( "bullet" ))* 50.0
- Bullet: Set X position to Alterable Value C("Bullet")
- Bullet: Set Y position to Alterable Value D("Bullet")

 
n/a
   

Post Reply



 



Advertisement

Worth A Click