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.
- 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")
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?
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.
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...
- 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")
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