|
|
by "query the host object" i mean it can find the end of the muzzle as
well as the direction it is pointing in order to know which drection to
shoot. maybe the host (space ship) should set global variables
indicating where the muzzle tip is and the direction. then the laser
would just use the globals. what do you think?
"Greg M. Johnson" wrote:
>
> ryan constantine wrote:
>
> > has anyone done this before? what i want to do is shoot a projectile in
> > an animation simply by setting a variable like shoot=true or something
> > like that. then, while it is true, i'd like a shot to be fired at
> > either steady or random intervals until set to false. each shot should
> > be its own entity. it should query the host object to know which
> > direction to move and from where it should start. then it should know
> > when it hits something and do something when it does. the projectile i
> > have in mind is a laser blast. would the particle patch help me here?
> > suggestions anyone?
>
> I had been thinking of setting up my own missile defense animation and see
> how hard it was!
>
> I was about to give longer advice here , but I got confused by the concept
> of a laser "querying its host object".
>
> You can set up a system where you have eight variables defining your "flying
> duck".
>
> Position (3 variables xyz, affected by velocity)
> Velocity (3 variables xyz, affected by gravity, willful acceleration)
> DeadYet (0=alive; 1=dead)
> TimeoDeath (Number of time frames SINCE I've been shot. )
>
> #if(DeadYet>0.5)
> #declare TimeoDeath=TimeoDeath+1;
> #else
> #if(vlength (Postion-Bulletposition)<ContactDistance) // ala Bob H
> #declare DeadYet=1;
> #end
> #end
>
> Then display duck, duck fragments, etc., based on above variables.
>
> See:
>
> http://www.geocities.com/pterandon/boids.html
Post a reply to this message
|
|