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

Werbad



Registered
  18/09/2002
Points
  235
21st January, 2007 at 09:34:38 -

That code won't work any better that setting the positions directly...

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

Set Value C and D to the bullets position when creating it

 
n/a

renneF



Registered
  02/08/2003
Points
  672
22nd January, 2007 at 06:54:42 -

@Axel
Yah I tried that, but it just made the bullet faster and skip lots of pixels when moving.

I'll give that a shot, Werbad.

 
Image

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
22nd January, 2007 at 11:50:56 -

I've always used that code, and never had any problems like that. Bah.

 
n/a

Ganymede Graphics

Possibly Insane

Registered
  17/04/2006
Points
  2711

GOTW JANUARY 2011
23rd January, 2007 at 01:40:12 -

Don't you use usually have to make the sine part of it negative?

 
Especially that.

Reno



Registered
  11/01/2005
Points
  906
24th January, 2007 at 14:35:32 -

ya axels method is the same method I use

 
Reborn Again
   

Post Reply



 



Advertisement

Worth A Click