Aggrav8d wrote:
I think nullpointer is right. The one I can't find a simple algorithm for is the purple bending laser beam in Raiden. Anyone have any thoughts?
Check my demo.
Nullpointer wrote:
as for the wiggly laser from raiden, i think raiden is spot on it seems basically like a chained/multisegment homing laser. imagine the homers from ikaruga leaping from one enemy to the next etc..
argg. That's the most horrible thing I have ever try to coded.
But there's one Japanese guy( I believe " I-Saint") who coded the same exact thing in his demo HL demo
I got tired coding that damm homing laser thing, Instead I just use a Lock on laser. which can't relock (or Homing) in to other objects, if target is destroy
Angrycoder wrote:
I'd be currious to hear how some of you have implimented this.
My Method
"Homing"
{
(oh yeah NewPos, Position and Target are vectors)
NewPos = Position - Target;
Normalize it you wanted too -> NewPos
NewPos *= Speed (which is speed * game interval);
}
In my demo you see how some of the cubes move into a line formations.
and you can also see how the "Lock-On" laser make a turn to hit the target instead of going straight to it.
First: created a subvector , which the missile is going to lock on to.
Subvector should be 90 degree from the missile(Target is the center, and the missile = 0 degree)
Second: make the subvector home in to the target and the Missile should home in to the subvector.
if there isn't anything wrong with your math codes, you''ll see that the missile is making a turn before it hit the target.
You can also make subvector goes faster then the missle,
which will give you a smaller arc
well if you wanted to created a bend laser.
first:
created 4 missles each lock on to the same target, but don't fire/move it at the same time.
second: ( the hardest)
try figuring how you''ll calculate the angles.
(Subvector = 0 degree, Missle is the center now)
because you need 8 vectors ( 2 * 4 Missles) for a Bezier curve
There's alot of calculations going around here cause you'll need to calculate the two sides.
the other 3 missle angles must also be set too.
And for Bullet Pattern.
Simple.
I use the Modified Homing Method.
make a vector spin around another vector (from the point where you shoot.)
now you just have to aim your bullets at the spinning vector.
Oh you can also check my bullet demo.
http://360.digitalthinker.org/Downloads/straybullet.zip
I call this "Spinners"
I also have some Ideas for "Spreaders" and "Sweepers"
Note
Digiben (
www.GameTutorials.com , now gone Selling tutorials)
Once wrote a Collision tutorials and from that tutorial I learn how to calculated the angles between two vectors.
and you'll also has to know how you convert radians in to degrees
if you wanted use glRotatef( degree, x, y, z);
which will make the bullet head point to the target.
instead of a "cheap colour ball" as a bullet.
